1#![doc = "MAVLink common dialect."]
2#![doc = ""]
3#![doc = "This file was automatically generated, do not edit."]
4#![allow(deprecated)]
5#[cfg(feature = "arbitrary")]
6use arbitrary::Arbitrary;
7#[allow(unused_imports)]
8use bitflags::{bitflags, Flags};
9use mavlink_core::{
10 bytes::Bytes, bytes_mut::BytesMut, types::CharArray, MavlinkVersion, Message, MessageData,
11};
12#[allow(unused_imports)]
13use num_derive::FromPrimitive;
14#[allow(unused_imports)]
15use num_derive::ToPrimitive;
16#[allow(unused_imports)]
17use num_traits::FromPrimitive;
18#[allow(unused_imports)]
19use num_traits::ToPrimitive;
20#[cfg(feature = "serde")]
21use serde::{Deserialize, Serialize};
22#[cfg(feature = "ts")]
23use ts_rs::TS;
24pub const MINOR_MAVLINK_VERSION: u8 = 3u8;
25pub const DIALECT_NUMBER: u8 = 0u8;
26#[cfg_attr(feature = "ts", derive(TS))]
27#[cfg_attr(feature = "ts", ts(export))]
28#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
29#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
30#[cfg_attr(feature = "serde", serde(tag = "type"))]
31#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
32#[repr(u32)]
33#[doc = "Actuator configuration, used to change a setting on an actuator. Component information metadata can be used to know which outputs support which commands."]
34pub enum ActuatorConfiguration {
35 #[doc = "Do nothing."]
36 ACTUATOR_CONFIGURATION_NONE = 0,
37 #[doc = "Command the actuator to beep now."]
38 ACTUATOR_CONFIGURATION_BEEP = 1,
39 #[doc = "Permanently set the actuator (ESC) to 3D mode (reversible thrust)."]
40 ACTUATOR_CONFIGURATION_3D_MODE_ON = 2,
41 #[doc = "Permanently set the actuator (ESC) to non 3D mode (non-reversible thrust)."]
42 ACTUATOR_CONFIGURATION_3D_MODE_OFF = 3,
43 #[doc = "Permanently set the actuator (ESC) to spin direction 1 (which can be clockwise or counter-clockwise)."]
44 ACTUATOR_CONFIGURATION_SPIN_DIRECTION1 = 4,
45 #[doc = "Permanently set the actuator (ESC) to spin direction 2 (opposite of direction 1)."]
46 ACTUATOR_CONFIGURATION_SPIN_DIRECTION2 = 5,
47}
48impl ActuatorConfiguration {
49 pub const DEFAULT: Self = Self::ACTUATOR_CONFIGURATION_NONE;
50}
51impl Default for ActuatorConfiguration {
52 fn default() -> Self {
53 Self::DEFAULT
54 }
55}
56#[cfg_attr(feature = "ts", derive(TS))]
57#[cfg_attr(feature = "ts", ts(export))]
58#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
59#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
60#[cfg_attr(feature = "serde", serde(tag = "type"))]
61#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
62#[repr(u32)]
63#[doc = "Actuator output function. Values greater or equal to 1000 are autopilot-specific."]
64pub enum ActuatorOutputFunction {
65 #[doc = "No function (disabled)."]
66 ACTUATOR_OUTPUT_FUNCTION_NONE = 0,
67 #[doc = "Motor 1"]
68 ACTUATOR_OUTPUT_FUNCTION_MOTOR1 = 1,
69 #[doc = "Motor 2"]
70 ACTUATOR_OUTPUT_FUNCTION_MOTOR2 = 2,
71 #[doc = "Motor 3"]
72 ACTUATOR_OUTPUT_FUNCTION_MOTOR3 = 3,
73 #[doc = "Motor 4"]
74 ACTUATOR_OUTPUT_FUNCTION_MOTOR4 = 4,
75 #[doc = "Motor 5"]
76 ACTUATOR_OUTPUT_FUNCTION_MOTOR5 = 5,
77 #[doc = "Motor 6"]
78 ACTUATOR_OUTPUT_FUNCTION_MOTOR6 = 6,
79 #[doc = "Motor 7"]
80 ACTUATOR_OUTPUT_FUNCTION_MOTOR7 = 7,
81 #[doc = "Motor 8"]
82 ACTUATOR_OUTPUT_FUNCTION_MOTOR8 = 8,
83 #[doc = "Motor 9"]
84 ACTUATOR_OUTPUT_FUNCTION_MOTOR9 = 9,
85 #[doc = "Motor 10"]
86 ACTUATOR_OUTPUT_FUNCTION_MOTOR10 = 10,
87 #[doc = "Motor 11"]
88 ACTUATOR_OUTPUT_FUNCTION_MOTOR11 = 11,
89 #[doc = "Motor 12"]
90 ACTUATOR_OUTPUT_FUNCTION_MOTOR12 = 12,
91 #[doc = "Motor 13"]
92 ACTUATOR_OUTPUT_FUNCTION_MOTOR13 = 13,
93 #[doc = "Motor 14"]
94 ACTUATOR_OUTPUT_FUNCTION_MOTOR14 = 14,
95 #[doc = "Motor 15"]
96 ACTUATOR_OUTPUT_FUNCTION_MOTOR15 = 15,
97 #[doc = "Motor 16"]
98 ACTUATOR_OUTPUT_FUNCTION_MOTOR16 = 16,
99 #[doc = "Servo 1"]
100 ACTUATOR_OUTPUT_FUNCTION_SERVO1 = 33,
101 #[doc = "Servo 2"]
102 ACTUATOR_OUTPUT_FUNCTION_SERVO2 = 34,
103 #[doc = "Servo 3"]
104 ACTUATOR_OUTPUT_FUNCTION_SERVO3 = 35,
105 #[doc = "Servo 4"]
106 ACTUATOR_OUTPUT_FUNCTION_SERVO4 = 36,
107 #[doc = "Servo 5"]
108 ACTUATOR_OUTPUT_FUNCTION_SERVO5 = 37,
109 #[doc = "Servo 6"]
110 ACTUATOR_OUTPUT_FUNCTION_SERVO6 = 38,
111 #[doc = "Servo 7"]
112 ACTUATOR_OUTPUT_FUNCTION_SERVO7 = 39,
113 #[doc = "Servo 8"]
114 ACTUATOR_OUTPUT_FUNCTION_SERVO8 = 40,
115 #[doc = "Servo 9"]
116 ACTUATOR_OUTPUT_FUNCTION_SERVO9 = 41,
117 #[doc = "Servo 10"]
118 ACTUATOR_OUTPUT_FUNCTION_SERVO10 = 42,
119 #[doc = "Servo 11"]
120 ACTUATOR_OUTPUT_FUNCTION_SERVO11 = 43,
121 #[doc = "Servo 12"]
122 ACTUATOR_OUTPUT_FUNCTION_SERVO12 = 44,
123 #[doc = "Servo 13"]
124 ACTUATOR_OUTPUT_FUNCTION_SERVO13 = 45,
125 #[doc = "Servo 14"]
126 ACTUATOR_OUTPUT_FUNCTION_SERVO14 = 46,
127 #[doc = "Servo 15"]
128 ACTUATOR_OUTPUT_FUNCTION_SERVO15 = 47,
129 #[doc = "Servo 16"]
130 ACTUATOR_OUTPUT_FUNCTION_SERVO16 = 48,
131}
132impl ActuatorOutputFunction {
133 pub const DEFAULT: Self = Self::ACTUATOR_OUTPUT_FUNCTION_NONE;
134}
135impl Default for ActuatorOutputFunction {
136 fn default() -> Self {
137 Self::DEFAULT
138 }
139}
140#[cfg_attr(feature = "ts", derive(TS))]
141#[cfg_attr(feature = "ts", ts(export))]
142#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
143#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
144#[cfg_attr(feature = "serde", serde(tag = "type"))]
145#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
146#[repr(u32)]
147#[doc = "Enumeration of the ADSB altimeter types"]
148pub enum AdsbAltitudeType {
149 #[doc = "Altitude reported from a Baro source using QNH reference"]
150 ADSB_ALTITUDE_TYPE_PRESSURE_QNH = 0,
151 #[doc = "Altitude reported from a GNSS source"]
152 ADSB_ALTITUDE_TYPE_GEOMETRIC = 1,
153}
154impl AdsbAltitudeType {
155 pub const DEFAULT: Self = Self::ADSB_ALTITUDE_TYPE_PRESSURE_QNH;
156}
157impl Default for AdsbAltitudeType {
158 fn default() -> Self {
159 Self::DEFAULT
160 }
161}
162#[cfg_attr(feature = "ts", derive(TS))]
163#[cfg_attr(feature = "ts", ts(export))]
164#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
165#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
166#[cfg_attr(feature = "serde", serde(tag = "type"))]
167#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
168#[repr(u32)]
169#[doc = "ADSB classification for the type of vehicle emitting the transponder signal"]
170pub enum AdsbEmitterType {
171 ADSB_EMITTER_TYPE_NO_INFO = 0,
172 ADSB_EMITTER_TYPE_LIGHT = 1,
173 ADSB_EMITTER_TYPE_SMALL = 2,
174 ADSB_EMITTER_TYPE_LARGE = 3,
175 ADSB_EMITTER_TYPE_HIGH_VORTEX_LARGE = 4,
176 ADSB_EMITTER_TYPE_HEAVY = 5,
177 ADSB_EMITTER_TYPE_HIGHLY_MANUV = 6,
178 ADSB_EMITTER_TYPE_ROTOCRAFT = 7,
179 ADSB_EMITTER_TYPE_UNASSIGNED = 8,
180 ADSB_EMITTER_TYPE_GLIDER = 9,
181 ADSB_EMITTER_TYPE_LIGHTER_AIR = 10,
182 ADSB_EMITTER_TYPE_PARACHUTE = 11,
183 ADSB_EMITTER_TYPE_ULTRA_LIGHT = 12,
184 ADSB_EMITTER_TYPE_UNASSIGNED2 = 13,
185 ADSB_EMITTER_TYPE_UAV = 14,
186 ADSB_EMITTER_TYPE_SPACE = 15,
187 ADSB_EMITTER_TYPE_UNASSGINED3 = 16,
188 ADSB_EMITTER_TYPE_EMERGENCY_SURFACE = 17,
189 ADSB_EMITTER_TYPE_SERVICE_SURFACE = 18,
190 ADSB_EMITTER_TYPE_POINT_OBSTACLE = 19,
191}
192impl AdsbEmitterType {
193 pub const DEFAULT: Self = Self::ADSB_EMITTER_TYPE_NO_INFO;
194}
195impl Default for AdsbEmitterType {
196 fn default() -> Self {
197 Self::DEFAULT
198 }
199}
200bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "These flags indicate status such as data validity of each data source. Set = data valid"] pub struct AdsbFlags : u16 { const ADSB_FLAGS_VALID_COORDS = 1 ; const ADSB_FLAGS_VALID_ALTITUDE = 2 ; const ADSB_FLAGS_VALID_HEADING = 4 ; const ADSB_FLAGS_VALID_VELOCITY = 8 ; const ADSB_FLAGS_VALID_CALLSIGN = 16 ; const ADSB_FLAGS_VALID_SQUAWK = 32 ; const ADSB_FLAGS_SIMULATED = 64 ; const ADSB_FLAGS_VERTICAL_VELOCITY_VALID = 128 ; const ADSB_FLAGS_BARO_VALID = 256 ; const ADSB_FLAGS_SOURCE_UAT = 32768 ; } }
201impl AdsbFlags {
202 pub const DEFAULT: Self = Self::ADSB_FLAGS_VALID_COORDS;
203}
204impl Default for AdsbFlags {
205 fn default() -> Self {
206 Self::DEFAULT
207 }
208}
209bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "These flags are used in the AIS_VESSEL.fields bitmask to indicate validity of data in the other message fields. When set, the data is valid."] pub struct AisFlags : u16 { # [doc = "1 = Position accuracy less than 10m, 0 = position accuracy greater than 10m."] const AIS_FLAGS_POSITION_ACCURACY = 1 ; const AIS_FLAGS_VALID_COG = 2 ; const AIS_FLAGS_VALID_VELOCITY = 4 ; # [doc = "1 = Velocity over 52.5765m/s (102.2 knots)"] const AIS_FLAGS_HIGH_VELOCITY = 8 ; const AIS_FLAGS_VALID_TURN_RATE = 16 ; # [doc = "Only the sign of the returned turn rate value is valid, either greater than 5deg/30s or less than -5deg/30s"] const AIS_FLAGS_TURN_RATE_SIGN_ONLY = 32 ; const AIS_FLAGS_VALID_DIMENSIONS = 64 ; # [doc = "Distance to bow is larger than 511m"] const AIS_FLAGS_LARGE_BOW_DIMENSION = 128 ; # [doc = "Distance to stern is larger than 511m"] const AIS_FLAGS_LARGE_STERN_DIMENSION = 256 ; # [doc = "Distance to port side is larger than 63m"] const AIS_FLAGS_LARGE_PORT_DIMENSION = 512 ; # [doc = "Distance to starboard side is larger than 63m"] const AIS_FLAGS_LARGE_STARBOARD_DIMENSION = 1024 ; const AIS_FLAGS_VALID_CALLSIGN = 2048 ; const AIS_FLAGS_VALID_NAME = 4096 ; } }
210impl AisFlags {
211 pub const DEFAULT: Self = Self::AIS_FLAGS_POSITION_ACCURACY;
212}
213impl Default for AisFlags {
214 fn default() -> Self {
215 Self::DEFAULT
216 }
217}
218#[cfg_attr(feature = "ts", derive(TS))]
219#[cfg_attr(feature = "ts", ts(export))]
220#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
221#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
222#[cfg_attr(feature = "serde", serde(tag = "type"))]
223#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
224#[repr(u32)]
225#[doc = "Navigational status of AIS vessel, enum duplicated from AIS standard, <https://gpsd.gitlab.io/gpsd/AIVDM.html>"]
226pub enum AisNavStatus {
227 #[doc = "Under way using engine."]
228 UNDER_WAY = 0,
229 AIS_NAV_ANCHORED = 1,
230 AIS_NAV_UN_COMMANDED = 2,
231 AIS_NAV_RESTRICTED_MANOEUVERABILITY = 3,
232 AIS_NAV_DRAUGHT_CONSTRAINED = 4,
233 AIS_NAV_MOORED = 5,
234 AIS_NAV_AGROUND = 6,
235 AIS_NAV_FISHING = 7,
236 AIS_NAV_SAILING = 8,
237 AIS_NAV_RESERVED_HSC = 9,
238 AIS_NAV_RESERVED_WIG = 10,
239 AIS_NAV_RESERVED_1 = 11,
240 AIS_NAV_RESERVED_2 = 12,
241 AIS_NAV_RESERVED_3 = 13,
242 #[doc = "Search And Rescue Transponder."]
243 AIS_NAV_AIS_SART = 14,
244 #[doc = "Not available (default)."]
245 AIS_NAV_UNKNOWN = 15,
246}
247impl AisNavStatus {
248 pub const DEFAULT: Self = Self::UNDER_WAY;
249}
250impl Default for AisNavStatus {
251 fn default() -> Self {
252 Self::DEFAULT
253 }
254}
255#[cfg_attr(feature = "ts", derive(TS))]
256#[cfg_attr(feature = "ts", ts(export))]
257#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
258#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
259#[cfg_attr(feature = "serde", serde(tag = "type"))]
260#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
261#[repr(u32)]
262#[doc = "Type of AIS vessel, enum duplicated from AIS standard, <https://gpsd.gitlab.io/gpsd/AIVDM.html>"]
263pub enum AisType {
264 #[doc = "Not available (default)."]
265 AIS_TYPE_UNKNOWN = 0,
266 AIS_TYPE_RESERVED_1 = 1,
267 AIS_TYPE_RESERVED_2 = 2,
268 AIS_TYPE_RESERVED_3 = 3,
269 AIS_TYPE_RESERVED_4 = 4,
270 AIS_TYPE_RESERVED_5 = 5,
271 AIS_TYPE_RESERVED_6 = 6,
272 AIS_TYPE_RESERVED_7 = 7,
273 AIS_TYPE_RESERVED_8 = 8,
274 AIS_TYPE_RESERVED_9 = 9,
275 AIS_TYPE_RESERVED_10 = 10,
276 AIS_TYPE_RESERVED_11 = 11,
277 AIS_TYPE_RESERVED_12 = 12,
278 AIS_TYPE_RESERVED_13 = 13,
279 AIS_TYPE_RESERVED_14 = 14,
280 AIS_TYPE_RESERVED_15 = 15,
281 AIS_TYPE_RESERVED_16 = 16,
282 AIS_TYPE_RESERVED_17 = 17,
283 AIS_TYPE_RESERVED_18 = 18,
284 AIS_TYPE_RESERVED_19 = 19,
285 #[doc = "Wing In Ground effect."]
286 AIS_TYPE_WIG = 20,
287 AIS_TYPE_WIG_HAZARDOUS_A = 21,
288 AIS_TYPE_WIG_HAZARDOUS_B = 22,
289 AIS_TYPE_WIG_HAZARDOUS_C = 23,
290 AIS_TYPE_WIG_HAZARDOUS_D = 24,
291 AIS_TYPE_WIG_RESERVED_1 = 25,
292 AIS_TYPE_WIG_RESERVED_2 = 26,
293 AIS_TYPE_WIG_RESERVED_3 = 27,
294 AIS_TYPE_WIG_RESERVED_4 = 28,
295 AIS_TYPE_WIG_RESERVED_5 = 29,
296 AIS_TYPE_FISHING = 30,
297 AIS_TYPE_TOWING = 31,
298 #[doc = "Towing: length exceeds 200m or breadth exceeds 25m."]
299 AIS_TYPE_TOWING_LARGE = 32,
300 #[doc = "Dredging or other underwater ops."]
301 AIS_TYPE_DREDGING = 33,
302 AIS_TYPE_DIVING = 34,
303 AIS_TYPE_MILITARY = 35,
304 AIS_TYPE_SAILING = 36,
305 AIS_TYPE_PLEASURE = 37,
306 AIS_TYPE_RESERVED_20 = 38,
307 AIS_TYPE_RESERVED_21 = 39,
308 #[doc = "High Speed Craft."]
309 AIS_TYPE_HSC = 40,
310 AIS_TYPE_HSC_HAZARDOUS_A = 41,
311 AIS_TYPE_HSC_HAZARDOUS_B = 42,
312 AIS_TYPE_HSC_HAZARDOUS_C = 43,
313 AIS_TYPE_HSC_HAZARDOUS_D = 44,
314 AIS_TYPE_HSC_RESERVED_1 = 45,
315 AIS_TYPE_HSC_RESERVED_2 = 46,
316 AIS_TYPE_HSC_RESERVED_3 = 47,
317 AIS_TYPE_HSC_RESERVED_4 = 48,
318 AIS_TYPE_HSC_UNKNOWN = 49,
319 AIS_TYPE_PILOT = 50,
320 #[doc = "Search And Rescue vessel."]
321 AIS_TYPE_SAR = 51,
322 AIS_TYPE_TUG = 52,
323 AIS_TYPE_PORT_TENDER = 53,
324 #[doc = "Anti-pollution equipment."]
325 AIS_TYPE_ANTI_POLLUTION = 54,
326 AIS_TYPE_LAW_ENFORCEMENT = 55,
327 AIS_TYPE_SPARE_LOCAL_1 = 56,
328 AIS_TYPE_SPARE_LOCAL_2 = 57,
329 AIS_TYPE_MEDICAL_TRANSPORT = 58,
330 #[doc = "Noncombatant ship according to RR Resolution No. 18."]
331 AIS_TYPE_NONECOMBATANT = 59,
332 AIS_TYPE_PASSENGER = 60,
333 AIS_TYPE_PASSENGER_HAZARDOUS_A = 61,
334 AIS_TYPE_PASSENGER_HAZARDOUS_B = 62,
335 AIS_TYPE_PASSENGER_HAZARDOUS_C = 63,
336 AIS_TYPE_PASSENGER_HAZARDOUS_D = 64,
337 AIS_TYPE_PASSENGER_RESERVED_1 = 65,
338 AIS_TYPE_PASSENGER_RESERVED_2 = 66,
339 AIS_TYPE_PASSENGER_RESERVED_3 = 67,
340 AIS_TYPE_PASSENGER_RESERVED_4 = 68,
341 AIS_TYPE_PASSENGER_UNKNOWN = 69,
342 AIS_TYPE_CARGO = 70,
343 AIS_TYPE_CARGO_HAZARDOUS_A = 71,
344 AIS_TYPE_CARGO_HAZARDOUS_B = 72,
345 AIS_TYPE_CARGO_HAZARDOUS_C = 73,
346 AIS_TYPE_CARGO_HAZARDOUS_D = 74,
347 AIS_TYPE_CARGO_RESERVED_1 = 75,
348 AIS_TYPE_CARGO_RESERVED_2 = 76,
349 AIS_TYPE_CARGO_RESERVED_3 = 77,
350 AIS_TYPE_CARGO_RESERVED_4 = 78,
351 AIS_TYPE_CARGO_UNKNOWN = 79,
352 AIS_TYPE_TANKER = 80,
353 AIS_TYPE_TANKER_HAZARDOUS_A = 81,
354 AIS_TYPE_TANKER_HAZARDOUS_B = 82,
355 AIS_TYPE_TANKER_HAZARDOUS_C = 83,
356 AIS_TYPE_TANKER_HAZARDOUS_D = 84,
357 AIS_TYPE_TANKER_RESERVED_1 = 85,
358 AIS_TYPE_TANKER_RESERVED_2 = 86,
359 AIS_TYPE_TANKER_RESERVED_3 = 87,
360 AIS_TYPE_TANKER_RESERVED_4 = 88,
361 AIS_TYPE_TANKER_UNKNOWN = 89,
362 AIS_TYPE_OTHER = 90,
363 AIS_TYPE_OTHER_HAZARDOUS_A = 91,
364 AIS_TYPE_OTHER_HAZARDOUS_B = 92,
365 AIS_TYPE_OTHER_HAZARDOUS_C = 93,
366 AIS_TYPE_OTHER_HAZARDOUS_D = 94,
367 AIS_TYPE_OTHER_RESERVED_1 = 95,
368 AIS_TYPE_OTHER_RESERVED_2 = 96,
369 AIS_TYPE_OTHER_RESERVED_3 = 97,
370 AIS_TYPE_OTHER_RESERVED_4 = 98,
371 AIS_TYPE_OTHER_UNKNOWN = 99,
372}
373impl AisType {
374 pub const DEFAULT: Self = Self::AIS_TYPE_UNKNOWN;
375}
376impl Default for AisType {
377 fn default() -> Self {
378 Self::DEFAULT
379 }
380}
381bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Bitmap to indicate which dimensions should be ignored by the vehicle: a value of 0b00000000 indicates that none of the setpoint dimensions should be ignored."] pub struct AttitudeTargetTypemask : u8 { # [doc = "Ignore body roll rate"] const ATTITUDE_TARGET_TYPEMASK_BODY_ROLL_RATE_IGNORE = 1 ; # [doc = "Ignore body pitch rate"] const ATTITUDE_TARGET_TYPEMASK_BODY_PITCH_RATE_IGNORE = 2 ; # [doc = "Ignore body yaw rate"] const ATTITUDE_TARGET_TYPEMASK_BODY_YAW_RATE_IGNORE = 4 ; # [doc = "Use 3D body thrust setpoint instead of throttle"] const ATTITUDE_TARGET_TYPEMASK_THRUST_BODY_SET = 32 ; # [doc = "Ignore throttle"] const ATTITUDE_TARGET_TYPEMASK_THROTTLE_IGNORE = 64 ; # [doc = "Ignore attitude"] const ATTITUDE_TARGET_TYPEMASK_ATTITUDE_IGNORE = 128 ; } }
382impl AttitudeTargetTypemask {
383 pub const DEFAULT: Self = Self::ATTITUDE_TARGET_TYPEMASK_BODY_ROLL_RATE_IGNORE;
384}
385impl Default for AttitudeTargetTypemask {
386 fn default() -> Self {
387 Self::DEFAULT
388 }
389}
390#[cfg_attr(feature = "ts", derive(TS))]
391#[cfg_attr(feature = "ts", ts(export))]
392#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
393#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
394#[cfg_attr(feature = "serde", serde(tag = "type"))]
395#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
396#[repr(u32)]
397#[doc = "Axes that will be autotuned by MAV_CMD_DO_AUTOTUNE_ENABLE. Note that at least one flag must be set in MAV_CMD_DO_AUTOTUNE_ENABLE.param2: if none are set, the flight stack will tune its default set of axes."]
398pub enum AutotuneAxis {
399 #[doc = "Autotune roll axis."]
400 AUTOTUNE_AXIS_ROLL = 1,
401 #[doc = "Autotune pitch axis."]
402 AUTOTUNE_AXIS_PITCH = 2,
403 #[doc = "Autotune yaw axis."]
404 AUTOTUNE_AXIS_YAW = 4,
405}
406impl AutotuneAxis {
407 pub const DEFAULT: Self = Self::AUTOTUNE_AXIS_ROLL;
408}
409impl Default for AutotuneAxis {
410 fn default() -> Self {
411 Self::DEFAULT
412 }
413}
414bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Camera capability flags (Bitmap)"] pub struct CameraCapFlags : u32 { # [doc = "Camera is able to record video"] const CAMERA_CAP_FLAGS_CAPTURE_VIDEO = 1 ; # [doc = "Camera is able to capture images"] const CAMERA_CAP_FLAGS_CAPTURE_IMAGE = 2 ; # [doc = "Camera has separate Video and Image/Photo modes (MAV_CMD_SET_CAMERA_MODE)"] const CAMERA_CAP_FLAGS_HAS_MODES = 4 ; # [doc = "Camera can capture images while in video mode"] const CAMERA_CAP_FLAGS_CAN_CAPTURE_IMAGE_IN_VIDEO_MODE = 8 ; # [doc = "Camera can capture videos while in Photo/Image mode"] const CAMERA_CAP_FLAGS_CAN_CAPTURE_VIDEO_IN_IMAGE_MODE = 16 ; # [doc = "Camera has image survey mode (MAV_CMD_SET_CAMERA_MODE)"] const CAMERA_CAP_FLAGS_HAS_IMAGE_SURVEY_MODE = 32 ; # [doc = "Camera has basic zoom control (MAV_CMD_SET_CAMERA_ZOOM)"] const CAMERA_CAP_FLAGS_HAS_BASIC_ZOOM = 64 ; # [doc = "Camera has basic focus control (MAV_CMD_SET_CAMERA_FOCUS)"] const CAMERA_CAP_FLAGS_HAS_BASIC_FOCUS = 128 ; # [doc = "Camera has video streaming capabilities (request VIDEO_STREAM_INFORMATION with MAV_CMD_REQUEST_MESSAGE for video streaming info)"] const CAMERA_CAP_FLAGS_HAS_VIDEO_STREAM = 256 ; # [doc = "Camera supports tracking of a point on the camera view."] const CAMERA_CAP_FLAGS_HAS_TRACKING_POINT = 512 ; # [doc = "Camera supports tracking of a selection rectangle on the camera view."] const CAMERA_CAP_FLAGS_HAS_TRACKING_RECTANGLE = 1024 ; # [doc = "Camera supports tracking geo status (CAMERA_TRACKING_GEO_STATUS)."] const CAMERA_CAP_FLAGS_HAS_TRACKING_GEO_STATUS = 2048 ; # [doc = "Camera supports absolute thermal range (request CAMERA_THERMAL_RANGE with MAV_CMD_REQUEST_MESSAGE)."] const CAMERA_CAP_FLAGS_HAS_THERMAL_RANGE = 4096 ; } }
415impl CameraCapFlags {
416 pub const DEFAULT: Self = Self::CAMERA_CAP_FLAGS_CAPTURE_VIDEO;
417}
418impl Default for CameraCapFlags {
419 fn default() -> Self {
420 Self::DEFAULT
421 }
422}
423#[cfg_attr(feature = "ts", derive(TS))]
424#[cfg_attr(feature = "ts", ts(export))]
425#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
426#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
427#[cfg_attr(feature = "serde", serde(tag = "type"))]
428#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
429#[repr(u32)]
430#[doc = "Camera Modes."]
431pub enum CameraMode {
432 #[doc = "Camera is in image/photo capture mode."]
433 CAMERA_MODE_IMAGE = 0,
434 #[doc = "Camera is in video capture mode."]
435 CAMERA_MODE_VIDEO = 1,
436 #[doc = "Camera is in image survey capture mode. It allows for camera controller to do specific settings for surveys."]
437 CAMERA_MODE_IMAGE_SURVEY = 2,
438}
439impl CameraMode {
440 pub const DEFAULT: Self = Self::CAMERA_MODE_IMAGE;
441}
442impl Default for CameraMode {
443 fn default() -> Self {
444 Self::DEFAULT
445 }
446}
447#[cfg_attr(feature = "ts", derive(TS))]
448#[cfg_attr(feature = "ts", ts(export))]
449#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
450#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
451#[cfg_attr(feature = "serde", serde(tag = "type"))]
452#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
453#[repr(u32)]
454#[doc = "Camera sources for MAV_CMD_SET_CAMERA_SOURCE"]
455pub enum CameraSource {
456 #[doc = "Default camera source."]
457 CAMERA_SOURCE_DEFAULT = 0,
458 #[doc = "RGB camera source."]
459 CAMERA_SOURCE_RGB = 1,
460 #[doc = "IR camera source."]
461 CAMERA_SOURCE_IR = 2,
462 #[doc = "NDVI camera source."]
463 CAMERA_SOURCE_NDVI = 3,
464}
465impl CameraSource {
466 pub const DEFAULT: Self = Self::CAMERA_SOURCE_DEFAULT;
467}
468impl Default for CameraSource {
469 fn default() -> Self {
470 Self::DEFAULT
471 }
472}
473#[cfg_attr(feature = "ts", derive(TS))]
474#[cfg_attr(feature = "ts", ts(export))]
475#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
476#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
477#[cfg_attr(feature = "serde", serde(tag = "type"))]
478#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
479#[repr(u32)]
480#[doc = "Camera tracking modes"]
481pub enum CameraTrackingMode {
482 #[doc = "Not tracking"]
483 CAMERA_TRACKING_MODE_NONE = 0,
484 #[doc = "Target is a point"]
485 CAMERA_TRACKING_MODE_POINT = 1,
486 #[doc = "Target is a rectangle"]
487 CAMERA_TRACKING_MODE_RECTANGLE = 2,
488}
489impl CameraTrackingMode {
490 pub const DEFAULT: Self = Self::CAMERA_TRACKING_MODE_NONE;
491}
492impl Default for CameraTrackingMode {
493 fn default() -> Self {
494 Self::DEFAULT
495 }
496}
497#[cfg_attr(feature = "ts", derive(TS))]
498#[cfg_attr(feature = "ts", ts(export))]
499#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
500#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
501#[cfg_attr(feature = "serde", serde(tag = "type"))]
502#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
503#[repr(u32)]
504#[doc = "Camera tracking status flags"]
505pub enum CameraTrackingStatusFlags {
506 #[doc = "Camera is not tracking"]
507 CAMERA_TRACKING_STATUS_FLAGS_IDLE = 0,
508 #[doc = "Camera is tracking"]
509 CAMERA_TRACKING_STATUS_FLAGS_ACTIVE = 1,
510 #[doc = "Camera tracking in error state"]
511 CAMERA_TRACKING_STATUS_FLAGS_ERROR = 2,
512}
513impl CameraTrackingStatusFlags {
514 pub const DEFAULT: Self = Self::CAMERA_TRACKING_STATUS_FLAGS_IDLE;
515}
516impl Default for CameraTrackingStatusFlags {
517 fn default() -> Self {
518 Self::DEFAULT
519 }
520}
521bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Camera tracking target data (shows where tracked target is within image)"] pub struct CameraTrackingTargetData : u8 { # [doc = "Target data embedded in image data (proprietary)"] const CAMERA_TRACKING_TARGET_DATA_EMBEDDED = 1 ; # [doc = "Target data rendered in image"] const CAMERA_TRACKING_TARGET_DATA_RENDERED = 2 ; # [doc = "Target data within status message (Point or Rectangle)"] const CAMERA_TRACKING_TARGET_DATA_IN_STATUS = 4 ; } }
522impl CameraTrackingTargetData {
523 pub const DEFAULT: Self = Self::CAMERA_TRACKING_TARGET_DATA_EMBEDDED;
524}
525impl Default for CameraTrackingTargetData {
526 fn default() -> Self {
527 Self::DEFAULT
528 }
529}
530#[cfg_attr(feature = "ts", derive(TS))]
531#[cfg_attr(feature = "ts", ts(export))]
532#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
533#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
534#[cfg_attr(feature = "serde", serde(tag = "type"))]
535#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
536#[repr(u32)]
537#[doc = "Zoom types for MAV_CMD_SET_CAMERA_ZOOM"]
538pub enum CameraZoomType {
539 #[doc = "Zoom one step increment (-1 for wide, 1 for tele)"]
540 ZOOM_TYPE_STEP = 0,
541 #[doc = "Continuous normalized zoom in/out rate until stopped. Range -1..1, negative: wide, positive: narrow/tele, 0 to stop zooming. Other values should be clipped to the range."]
542 ZOOM_TYPE_CONTINUOUS = 1,
543 #[doc = "Zoom value as proportion of full camera range (a percentage value between 0.0 and 100.0)"]
544 ZOOM_TYPE_RANGE = 2,
545 #[doc = "Zoom value/variable focal length in millimetres. Note that there is no message to get the valid zoom range of the camera, so this can type can only be used for cameras where the zoom range is known (implying that this cannot reliably be used in a GCS for an arbitrary camera)"]
546 ZOOM_TYPE_FOCAL_LENGTH = 3,
547 #[doc = "Zoom value as horizontal field of view in degrees."]
548 ZOOM_TYPE_HORIZONTAL_FOV = 4,
549}
550impl CameraZoomType {
551 pub const DEFAULT: Self = Self::ZOOM_TYPE_STEP;
552}
553impl Default for CameraZoomType {
554 fn default() -> Self {
555 Self::DEFAULT
556 }
557}
558#[cfg_attr(feature = "ts", derive(TS))]
559#[cfg_attr(feature = "ts", ts(export))]
560#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
561#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
562#[cfg_attr(feature = "serde", serde(tag = "type"))]
563#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
564#[repr(u32)]
565pub enum CanFilterOp {
566 CAN_FILTER_REPLACE = 0,
567 CAN_FILTER_ADD = 1,
568 CAN_FILTER_REMOVE = 2,
569}
570impl CanFilterOp {
571 pub const DEFAULT: Self = Self::CAN_FILTER_REPLACE;
572}
573impl Default for CanFilterOp {
574 fn default() -> Self {
575 Self::DEFAULT
576 }
577}
578#[cfg_attr(feature = "ts", derive(TS))]
579#[cfg_attr(feature = "ts", ts(export))]
580#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
581#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
582#[cfg_attr(feature = "serde", serde(tag = "type"))]
583#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
584#[repr(u32)]
585#[doc = "Possible responses from a CELLULAR_CONFIG message."]
586pub enum CellularConfigResponse {
587 #[doc = "Changes accepted."]
588 CELLULAR_CONFIG_RESPONSE_ACCEPTED = 0,
589 #[doc = "Invalid APN."]
590 CELLULAR_CONFIG_RESPONSE_APN_ERROR = 1,
591 #[doc = "Invalid PIN."]
592 CELLULAR_CONFIG_RESPONSE_PIN_ERROR = 2,
593 #[doc = "Changes rejected."]
594 CELLULAR_CONFIG_RESPONSE_REJECTED = 3,
595 #[doc = "PUK is required to unblock SIM card."]
596 CELLULAR_CONFIG_BLOCKED_PUK_REQUIRED = 4,
597}
598impl CellularConfigResponse {
599 pub const DEFAULT: Self = Self::CELLULAR_CONFIG_RESPONSE_ACCEPTED;
600}
601impl Default for CellularConfigResponse {
602 fn default() -> Self {
603 Self::DEFAULT
604 }
605}
606#[cfg_attr(feature = "ts", derive(TS))]
607#[cfg_attr(feature = "ts", ts(export))]
608#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
609#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
610#[cfg_attr(feature = "serde", serde(tag = "type"))]
611#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
612#[repr(u32)]
613#[doc = "These flags are used to diagnose the failure state of CELLULAR_STATUS"]
614pub enum CellularNetworkFailedReason {
615 #[doc = "No error"]
616 CELLULAR_NETWORK_FAILED_REASON_NONE = 0,
617 #[doc = "Error state is unknown"]
618 CELLULAR_NETWORK_FAILED_REASON_UNKNOWN = 1,
619 #[doc = "SIM is required for the modem but missing"]
620 CELLULAR_NETWORK_FAILED_REASON_SIM_MISSING = 2,
621 #[doc = "SIM is available, but not usable for connection"]
622 CELLULAR_NETWORK_FAILED_REASON_SIM_ERROR = 3,
623}
624impl CellularNetworkFailedReason {
625 pub const DEFAULT: Self = Self::CELLULAR_NETWORK_FAILED_REASON_NONE;
626}
627impl Default for CellularNetworkFailedReason {
628 fn default() -> Self {
629 Self::DEFAULT
630 }
631}
632#[cfg_attr(feature = "ts", derive(TS))]
633#[cfg_attr(feature = "ts", ts(export))]
634#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
635#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
636#[cfg_attr(feature = "serde", serde(tag = "type"))]
637#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
638#[repr(u32)]
639#[doc = "Cellular network radio type"]
640pub enum CellularNetworkRadioType {
641 CELLULAR_NETWORK_RADIO_TYPE_NONE = 0,
642 CELLULAR_NETWORK_RADIO_TYPE_GSM = 1,
643 CELLULAR_NETWORK_RADIO_TYPE_CDMA = 2,
644 CELLULAR_NETWORK_RADIO_TYPE_WCDMA = 3,
645 CELLULAR_NETWORK_RADIO_TYPE_LTE = 4,
646}
647impl CellularNetworkRadioType {
648 pub const DEFAULT: Self = Self::CELLULAR_NETWORK_RADIO_TYPE_NONE;
649}
650impl Default for CellularNetworkRadioType {
651 fn default() -> Self {
652 Self::DEFAULT
653 }
654}
655#[cfg_attr(feature = "ts", derive(TS))]
656#[cfg_attr(feature = "ts", ts(export))]
657#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
658#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
659#[cfg_attr(feature = "serde", serde(tag = "type"))]
660#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
661#[repr(u32)]
662#[doc = "These flags encode the cellular network status"]
663pub enum CellularStatusFlag {
664 #[doc = "State unknown or not reportable."]
665 CELLULAR_STATUS_FLAG_UNKNOWN = 0,
666 #[doc = "Modem is unusable"]
667 CELLULAR_STATUS_FLAG_FAILED = 1,
668 #[doc = "Modem is being initialized"]
669 CELLULAR_STATUS_FLAG_INITIALIZING = 2,
670 #[doc = "Modem is locked"]
671 CELLULAR_STATUS_FLAG_LOCKED = 3,
672 #[doc = "Modem is not enabled and is powered down"]
673 CELLULAR_STATUS_FLAG_DISABLED = 4,
674 #[doc = "Modem is currently transitioning to the CELLULAR_STATUS_FLAG_DISABLED state"]
675 CELLULAR_STATUS_FLAG_DISABLING = 5,
676 #[doc = "Modem is currently transitioning to the CELLULAR_STATUS_FLAG_ENABLED state"]
677 CELLULAR_STATUS_FLAG_ENABLING = 6,
678 #[doc = "Modem is enabled and powered on but not registered with a network provider and not available for data connections"]
679 CELLULAR_STATUS_FLAG_ENABLED = 7,
680 #[doc = "Modem is searching for a network provider to register"]
681 CELLULAR_STATUS_FLAG_SEARCHING = 8,
682 #[doc = "Modem is registered with a network provider, and data connections and messaging may be available for use"]
683 CELLULAR_STATUS_FLAG_REGISTERED = 9,
684 #[doc = "Modem is disconnecting and deactivating the last active packet data bearer. This state will not be entered if more than one packet data bearer is active and one of the active bearers is deactivated"]
685 CELLULAR_STATUS_FLAG_DISCONNECTING = 10,
686 #[doc = "Modem is activating and connecting the first packet data bearer. Subsequent bearer activations when another bearer is already active do not cause this state to be entered"]
687 CELLULAR_STATUS_FLAG_CONNECTING = 11,
688 #[doc = "One or more packet data bearers is active and connected"]
689 CELLULAR_STATUS_FLAG_CONNECTED = 12,
690}
691impl CellularStatusFlag {
692 pub const DEFAULT: Self = Self::CELLULAR_STATUS_FLAG_UNKNOWN;
693}
694impl Default for CellularStatusFlag {
695 fn default() -> Self {
696 Self::DEFAULT
697 }
698}
699#[cfg_attr(feature = "ts", derive(TS))]
700#[cfg_attr(feature = "ts", ts(export))]
701#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
702#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
703#[cfg_attr(feature = "serde", serde(tag = "type"))]
704#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
705#[repr(u32)]
706#[doc = "Supported component metadata types. These are used in the \"general\" metadata file returned by COMPONENT_METADATA to provide information about supported metadata types. The types are not used directly in MAVLink messages."]
707pub enum CompMetadataType {
708 #[doc = "General information about the component. General metadata includes information about other metadata types supported by the component. Files of this type must be supported, and must be downloadable from vehicle using a MAVLink FTP URI."]
709 COMP_METADATA_TYPE_GENERAL = 0,
710 #[doc = "Parameter meta data."]
711 COMP_METADATA_TYPE_PARAMETER = 1,
712 #[doc = "Meta data that specifies which commands and command parameters the vehicle supports. (WIP)"]
713 COMP_METADATA_TYPE_COMMANDS = 2,
714 #[doc = "Meta data that specifies external non-MAVLink peripherals."]
715 COMP_METADATA_TYPE_PERIPHERALS = 3,
716 #[doc = "Meta data for the events interface."]
717 COMP_METADATA_TYPE_EVENTS = 4,
718 #[doc = "Meta data for actuator configuration (motors, servos and vehicle geometry) and testing."]
719 COMP_METADATA_TYPE_ACTUATORS = 5,
720}
721impl CompMetadataType {
722 pub const DEFAULT: Self = Self::COMP_METADATA_TYPE_GENERAL;
723}
724impl Default for CompMetadataType {
725 fn default() -> Self {
726 Self::DEFAULT
727 }
728}
729#[cfg_attr(feature = "ts", derive(TS))]
730#[cfg_attr(feature = "ts", ts(export))]
731#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
732#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
733#[cfg_attr(feature = "serde", serde(tag = "type"))]
734#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
735#[repr(u32)]
736#[doc = "Indicates the ESC connection type."]
737pub enum EscConnectionType {
738 #[doc = "Traditional PPM ESC."]
739 ESC_CONNECTION_TYPE_PPM = 0,
740 #[doc = "Serial Bus connected ESC."]
741 ESC_CONNECTION_TYPE_SERIAL = 1,
742 #[doc = "One Shot PPM ESC."]
743 ESC_CONNECTION_TYPE_ONESHOT = 2,
744 #[doc = "I2C ESC."]
745 ESC_CONNECTION_TYPE_I2C = 3,
746 #[doc = "CAN-Bus ESC."]
747 ESC_CONNECTION_TYPE_CAN = 4,
748 #[doc = "DShot ESC."]
749 ESC_CONNECTION_TYPE_DSHOT = 5,
750}
751impl EscConnectionType {
752 pub const DEFAULT: Self = Self::ESC_CONNECTION_TYPE_PPM;
753}
754impl Default for EscConnectionType {
755 fn default() -> Self {
756 Self::DEFAULT
757 }
758}
759bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Flags to report ESC failures."] pub struct EscFailureFlags : u16 { # [doc = "Over current failure."] const ESC_FAILURE_OVER_CURRENT = 1 ; # [doc = "Over voltage failure."] const ESC_FAILURE_OVER_VOLTAGE = 2 ; # [doc = "Over temperature failure."] const ESC_FAILURE_OVER_TEMPERATURE = 4 ; # [doc = "Over RPM failure."] const ESC_FAILURE_OVER_RPM = 8 ; # [doc = "Inconsistent command failure i.e. out of bounds."] const ESC_FAILURE_INCONSISTENT_CMD = 16 ; # [doc = "Motor stuck failure."] const ESC_FAILURE_MOTOR_STUCK = 32 ; # [doc = "Generic ESC failure."] const ESC_FAILURE_GENERIC = 64 ; } }
760impl EscFailureFlags {
761 pub const DEFAULT: Self = Self::ESC_FAILURE_OVER_CURRENT;
762}
763impl Default for EscFailureFlags {
764 fn default() -> Self {
765 Self::DEFAULT
766 }
767}
768bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Flags in ESTIMATOR_STATUS message"] pub struct EstimatorStatusFlags : u16 { # [doc = "True if the attitude estimate is good"] const ESTIMATOR_ATTITUDE = 1 ; # [doc = "True if the horizontal velocity estimate is good"] const ESTIMATOR_VELOCITY_HORIZ = 2 ; # [doc = "True if the vertical velocity estimate is good"] const ESTIMATOR_VELOCITY_VERT = 4 ; # [doc = "True if the horizontal position (relative) estimate is good"] const ESTIMATOR_POS_HORIZ_REL = 8 ; # [doc = "True if the horizontal position (absolute) estimate is good"] const ESTIMATOR_POS_HORIZ_ABS = 16 ; # [doc = "True if the vertical position (absolute) estimate is good"] const ESTIMATOR_POS_VERT_ABS = 32 ; # [doc = "True if the vertical position (above ground) estimate is good"] const ESTIMATOR_POS_VERT_AGL = 64 ; # [doc = "True if the EKF is in a constant position mode and is not using external measurements (eg GPS or optical flow)"] const ESTIMATOR_CONST_POS_MODE = 128 ; # [doc = "True if the EKF has sufficient data to enter a mode that will provide a (relative) position estimate"] const ESTIMATOR_PRED_POS_HORIZ_REL = 256 ; # [doc = "True if the EKF has sufficient data to enter a mode that will provide a (absolute) position estimate"] const ESTIMATOR_PRED_POS_HORIZ_ABS = 512 ; # [doc = "True if the EKF has detected a GPS glitch"] const ESTIMATOR_GPS_GLITCH = 1024 ; # [doc = "True if the EKF has detected bad accelerometer data"] const ESTIMATOR_ACCEL_ERROR = 2048 ; } }
769impl EstimatorStatusFlags {
770 pub const DEFAULT: Self = Self::ESTIMATOR_ATTITUDE;
771}
772impl Default for EstimatorStatusFlags {
773 fn default() -> Self {
774 Self::DEFAULT
775 }
776}
777#[cfg_attr(feature = "ts", derive(TS))]
778#[cfg_attr(feature = "ts", ts(export))]
779#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
780#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
781#[cfg_attr(feature = "serde", serde(tag = "type"))]
782#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
783#[repr(u32)]
784#[doc = "List of possible failure type to inject."]
785pub enum FailureType {
786 #[doc = "No failure injected, used to reset a previous failure."]
787 FAILURE_TYPE_OK = 0,
788 #[doc = "Sets unit off, so completely non-responsive."]
789 FAILURE_TYPE_OFF = 1,
790 #[doc = "Unit is stuck e.g. keeps reporting the same value."]
791 FAILURE_TYPE_STUCK = 2,
792 #[doc = "Unit is reporting complete garbage."]
793 FAILURE_TYPE_GARBAGE = 3,
794 #[doc = "Unit is consistently wrong."]
795 FAILURE_TYPE_WRONG = 4,
796 #[doc = "Unit is slow, so e.g. reporting at slower than expected rate."]
797 FAILURE_TYPE_SLOW = 5,
798 #[doc = "Data of unit is delayed in time."]
799 FAILURE_TYPE_DELAYED = 6,
800 #[doc = "Unit is sometimes working, sometimes not."]
801 FAILURE_TYPE_INTERMITTENT = 7,
802}
803impl FailureType {
804 pub const DEFAULT: Self = Self::FAILURE_TYPE_OK;
805}
806impl Default for FailureType {
807 fn default() -> Self {
808 Self::DEFAULT
809 }
810}
811#[cfg_attr(feature = "ts", derive(TS))]
812#[cfg_attr(feature = "ts", ts(export))]
813#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
814#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
815#[cfg_attr(feature = "serde", serde(tag = "type"))]
816#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
817#[repr(u32)]
818#[doc = "List of possible units where failures can be injected."]
819pub enum FailureUnit {
820 FAILURE_UNIT_SENSOR_GYRO = 0,
821 FAILURE_UNIT_SENSOR_ACCEL = 1,
822 FAILURE_UNIT_SENSOR_MAG = 2,
823 FAILURE_UNIT_SENSOR_BARO = 3,
824 FAILURE_UNIT_SENSOR_GPS = 4,
825 FAILURE_UNIT_SENSOR_OPTICAL_FLOW = 5,
826 FAILURE_UNIT_SENSOR_VIO = 6,
827 FAILURE_UNIT_SENSOR_DISTANCE_SENSOR = 7,
828 FAILURE_UNIT_SENSOR_AIRSPEED = 8,
829 FAILURE_UNIT_SYSTEM_BATTERY = 100,
830 FAILURE_UNIT_SYSTEM_MOTOR = 101,
831 FAILURE_UNIT_SYSTEM_SERVO = 102,
832 FAILURE_UNIT_SYSTEM_AVOIDANCE = 103,
833 FAILURE_UNIT_SYSTEM_RC_SIGNAL = 104,
834 FAILURE_UNIT_SYSTEM_MAVLINK_SIGNAL = 105,
835}
836impl FailureUnit {
837 pub const DEFAULT: Self = Self::FAILURE_UNIT_SENSOR_GYRO;
838}
839impl Default for FailureUnit {
840 fn default() -> Self {
841 Self::DEFAULT
842 }
843}
844#[cfg_attr(feature = "ts", derive(TS))]
845#[cfg_attr(feature = "ts", ts(export))]
846#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
847#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
848#[cfg_attr(feature = "serde", serde(tag = "type"))]
849#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
850#[repr(u32)]
851pub enum FenceBreach {
852 #[doc = "No last fence breach"]
853 FENCE_BREACH_NONE = 0,
854 #[doc = "Breached minimum altitude"]
855 FENCE_BREACH_MINALT = 1,
856 #[doc = "Breached maximum altitude"]
857 FENCE_BREACH_MAXALT = 2,
858 #[doc = "Breached fence boundary"]
859 FENCE_BREACH_BOUNDARY = 3,
860}
861impl FenceBreach {
862 pub const DEFAULT: Self = Self::FENCE_BREACH_NONE;
863}
864impl Default for FenceBreach {
865 fn default() -> Self {
866 Self::DEFAULT
867 }
868}
869#[cfg_attr(feature = "ts", derive(TS))]
870#[cfg_attr(feature = "ts", ts(export))]
871#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
872#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
873#[cfg_attr(feature = "serde", serde(tag = "type"))]
874#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
875#[repr(u32)]
876#[doc = "Actions being taken to mitigate/prevent fence breach"]
877pub enum FenceMitigate {
878 #[doc = "Unknown"]
879 FENCE_MITIGATE_UNKNOWN = 0,
880 #[doc = "No actions being taken"]
881 FENCE_MITIGATE_NONE = 1,
882 #[doc = "Velocity limiting active to prevent breach"]
883 FENCE_MITIGATE_VEL_LIMIT = 2,
884}
885impl FenceMitigate {
886 pub const DEFAULT: Self = Self::FENCE_MITIGATE_UNKNOWN;
887}
888impl Default for FenceMitigate {
889 fn default() -> Self {
890 Self::DEFAULT
891 }
892}
893#[cfg_attr(feature = "ts", derive(TS))]
894#[cfg_attr(feature = "ts", ts(export))]
895#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
896#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
897#[cfg_attr(feature = "serde", serde(tag = "type"))]
898#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
899#[repr(u32)]
900#[doc = "Fence types to enable or disable when using MAV_CMD_DO_FENCE_ENABLE. Note that at least one of these flags must be set in MAV_CMD_DO_FENCE_ENABLE.param2. If none are set, the flight stack will ignore the field and enable/disable its default set of fences (usually all of them)."]
901pub enum FenceType {
902 #[doc = "Maximum altitude fence"]
903 FENCE_TYPE_ALT_MAX = 1,
904 #[doc = "Circle fence"]
905 FENCE_TYPE_CIRCLE = 2,
906 #[doc = "Polygon fence"]
907 FENCE_TYPE_POLYGON = 4,
908 #[doc = "Minimum altitude fence"]
909 FENCE_TYPE_ALT_MIN = 8,
910}
911impl FenceType {
912 pub const DEFAULT: Self = Self::FENCE_TYPE_ALT_MAX;
913}
914impl Default for FenceType {
915 fn default() -> Self {
916 Self::DEFAULT
917 }
918}
919#[cfg_attr(feature = "ts", derive(TS))]
920#[cfg_attr(feature = "ts", ts(export))]
921#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
922#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
923#[cfg_attr(feature = "serde", serde(tag = "type"))]
924#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
925#[repr(u32)]
926#[doc = "These values define the type of firmware release. These values indicate the first version or release of this type. For example the first alpha release would be 64, the second would be 65."]
927pub enum FirmwareVersionType {
928 #[doc = "development release"]
929 FIRMWARE_VERSION_TYPE_DEV = 0,
930 #[doc = "alpha release"]
931 FIRMWARE_VERSION_TYPE_ALPHA = 64,
932 #[doc = "beta release"]
933 FIRMWARE_VERSION_TYPE_BETA = 128,
934 #[doc = "release candidate"]
935 FIRMWARE_VERSION_TYPE_RC = 192,
936 #[doc = "official stable release"]
937 FIRMWARE_VERSION_TYPE_OFFICIAL = 255,
938}
939impl FirmwareVersionType {
940 pub const DEFAULT: Self = Self::FIRMWARE_VERSION_TYPE_DEV;
941}
942impl Default for FirmwareVersionType {
943 fn default() -> Self {
944 Self::DEFAULT
945 }
946}
947bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Gimbal device (low level) capability flags (bitmap)."] pub struct GimbalDeviceCapFlags : u16 { # [doc = "Gimbal device supports a retracted position."] const GIMBAL_DEVICE_CAP_FLAGS_HAS_RETRACT = 1 ; # [doc = "Gimbal device supports a horizontal, forward looking position, stabilized."] const GIMBAL_DEVICE_CAP_FLAGS_HAS_NEUTRAL = 2 ; # [doc = "Gimbal device supports rotating around roll axis."] const GIMBAL_DEVICE_CAP_FLAGS_HAS_ROLL_AXIS = 4 ; # [doc = "Gimbal device supports to follow a roll angle relative to the vehicle."] const GIMBAL_DEVICE_CAP_FLAGS_HAS_ROLL_FOLLOW = 8 ; # [doc = "Gimbal device supports locking to a roll angle (generally that's the default with roll stabilized)."] const GIMBAL_DEVICE_CAP_FLAGS_HAS_ROLL_LOCK = 16 ; # [doc = "Gimbal device supports rotating around pitch axis."] const GIMBAL_DEVICE_CAP_FLAGS_HAS_PITCH_AXIS = 32 ; # [doc = "Gimbal device supports to follow a pitch angle relative to the vehicle."] const GIMBAL_DEVICE_CAP_FLAGS_HAS_PITCH_FOLLOW = 64 ; # [doc = "Gimbal device supports locking to a pitch angle (generally that's the default with pitch stabilized)."] const GIMBAL_DEVICE_CAP_FLAGS_HAS_PITCH_LOCK = 128 ; # [doc = "Gimbal device supports rotating around yaw axis."] const GIMBAL_DEVICE_CAP_FLAGS_HAS_YAW_AXIS = 256 ; # [doc = "Gimbal device supports to follow a yaw angle relative to the vehicle (generally that's the default)."] const GIMBAL_DEVICE_CAP_FLAGS_HAS_YAW_FOLLOW = 512 ; # [doc = "Gimbal device supports locking to an absolute heading, i.e., yaw angle relative to North (earth frame, often this is an option available)."] const GIMBAL_DEVICE_CAP_FLAGS_HAS_YAW_LOCK = 1024 ; # [doc = "Gimbal device supports yawing/panning infinitely (e.g. using slip disk)."] const GIMBAL_DEVICE_CAP_FLAGS_SUPPORTS_INFINITE_YAW = 2048 ; # [doc = "Gimbal device supports yaw angles and angular velocities relative to North (earth frame). This usually requires support by an autopilot via AUTOPILOT_STATE_FOR_GIMBAL_DEVICE. Support can go on and off during runtime, which is reported by the flag GIMBAL_DEVICE_FLAGS_CAN_ACCEPT_YAW_IN_EARTH_FRAME."] const GIMBAL_DEVICE_CAP_FLAGS_SUPPORTS_YAW_IN_EARTH_FRAME = 4096 ; # [doc = "Gimbal device supports radio control inputs as an alternative input for controlling the gimbal orientation."] const GIMBAL_DEVICE_CAP_FLAGS_HAS_RC_INPUTS = 8192 ; } }
948impl GimbalDeviceCapFlags {
949 pub const DEFAULT: Self = Self::GIMBAL_DEVICE_CAP_FLAGS_HAS_RETRACT;
950}
951impl Default for GimbalDeviceCapFlags {
952 fn default() -> Self {
953 Self::DEFAULT
954 }
955}
956bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Gimbal device (low level) error flags (bitmap, 0 means no error)"] pub struct GimbalDeviceErrorFlags : u32 { # [doc = "Gimbal device is limited by hardware roll limit."] const GIMBAL_DEVICE_ERROR_FLAGS_AT_ROLL_LIMIT = 1 ; # [doc = "Gimbal device is limited by hardware pitch limit."] const GIMBAL_DEVICE_ERROR_FLAGS_AT_PITCH_LIMIT = 2 ; # [doc = "Gimbal device is limited by hardware yaw limit."] const GIMBAL_DEVICE_ERROR_FLAGS_AT_YAW_LIMIT = 4 ; # [doc = "There is an error with the gimbal encoders."] const GIMBAL_DEVICE_ERROR_FLAGS_ENCODER_ERROR = 8 ; # [doc = "There is an error with the gimbal power source."] const GIMBAL_DEVICE_ERROR_FLAGS_POWER_ERROR = 16 ; # [doc = "There is an error with the gimbal motors."] const GIMBAL_DEVICE_ERROR_FLAGS_MOTOR_ERROR = 32 ; # [doc = "There is an error with the gimbal's software."] const GIMBAL_DEVICE_ERROR_FLAGS_SOFTWARE_ERROR = 64 ; # [doc = "There is an error with the gimbal's communication."] const GIMBAL_DEVICE_ERROR_FLAGS_COMMS_ERROR = 128 ; # [doc = "Gimbal device is currently calibrating."] const GIMBAL_DEVICE_ERROR_FLAGS_CALIBRATION_RUNNING = 256 ; # [doc = "Gimbal device is not assigned to a gimbal manager."] const GIMBAL_DEVICE_ERROR_FLAGS_NO_MANAGER = 512 ; } }
957impl GimbalDeviceErrorFlags {
958 pub const DEFAULT: Self = Self::GIMBAL_DEVICE_ERROR_FLAGS_AT_ROLL_LIMIT;
959}
960impl Default for GimbalDeviceErrorFlags {
961 fn default() -> Self {
962 Self::DEFAULT
963 }
964}
965bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Flags for gimbal device (lower level) operation."] pub struct GimbalDeviceFlags : u16 { # [doc = "Set to retracted safe position (no stabilization), takes precedence over all other flags."] const GIMBAL_DEVICE_FLAGS_RETRACT = 1 ; # [doc = "Set to neutral/default position, taking precedence over all other flags except RETRACT. Neutral is commonly forward-facing and horizontal (roll=pitch=yaw=0) but may be any orientation."] const GIMBAL_DEVICE_FLAGS_NEUTRAL = 2 ; # [doc = "Lock roll angle to absolute angle relative to horizon (not relative to vehicle). This is generally the default with a stabilizing gimbal."] const GIMBAL_DEVICE_FLAGS_ROLL_LOCK = 4 ; # [doc = "Lock pitch angle to absolute angle relative to horizon (not relative to vehicle). This is generally the default with a stabilizing gimbal."] const GIMBAL_DEVICE_FLAGS_PITCH_LOCK = 8 ; # [doc = "Lock yaw angle to absolute angle relative to North (not relative to vehicle). If this flag is set, the yaw angle and z component of angular velocity are relative to North (earth frame, x-axis pointing North), else they are relative to the vehicle heading (vehicle frame, earth frame rotated so that the x-axis is pointing forward)."] const GIMBAL_DEVICE_FLAGS_YAW_LOCK = 16 ; # [doc = "Yaw angle and z component of angular velocity are relative to the vehicle heading (vehicle frame, earth frame rotated such that the x-axis is pointing forward)."] const GIMBAL_DEVICE_FLAGS_YAW_IN_VEHICLE_FRAME = 32 ; # [doc = "Yaw angle and z component of angular velocity are relative to North (earth frame, x-axis is pointing North)."] const GIMBAL_DEVICE_FLAGS_YAW_IN_EARTH_FRAME = 64 ; # [doc = "Gimbal device can accept yaw angle inputs relative to North (earth frame). This flag is only for reporting (attempts to set this flag are ignored)."] const GIMBAL_DEVICE_FLAGS_ACCEPTS_YAW_IN_EARTH_FRAME = 128 ; # [doc = "The gimbal orientation is set exclusively by the RC signals feed to the gimbal's radio control inputs. MAVLink messages for setting the gimbal orientation (GIMBAL_DEVICE_SET_ATTITUDE) are ignored."] const GIMBAL_DEVICE_FLAGS_RC_EXCLUSIVE = 256 ; # [doc = "The gimbal orientation is determined by combining/mixing the RC signals feed to the gimbal's radio control inputs and the MAVLink messages for setting the gimbal orientation (GIMBAL_DEVICE_SET_ATTITUDE). How these two controls are combined or mixed is not defined by the protocol but is up to the implementation."] const GIMBAL_DEVICE_FLAGS_RC_MIXED = 512 ; } }
966impl GimbalDeviceFlags {
967 pub const DEFAULT: Self = Self::GIMBAL_DEVICE_FLAGS_RETRACT;
968}
969impl Default for GimbalDeviceFlags {
970 fn default() -> Self {
971 Self::DEFAULT
972 }
973}
974bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Gimbal manager high level capability flags (bitmap). The first 16 bits are identical to the GIMBAL_DEVICE_CAP_FLAGS. However, the gimbal manager does not need to copy the flags from the gimbal but can also enhance the capabilities and thus add flags."] pub struct GimbalManagerCapFlags : u32 { # [doc = "Based on GIMBAL_DEVICE_CAP_FLAGS_HAS_RETRACT."] const GIMBAL_MANAGER_CAP_FLAGS_HAS_RETRACT = 1 ; # [doc = "Based on GIMBAL_DEVICE_CAP_FLAGS_HAS_NEUTRAL."] const GIMBAL_MANAGER_CAP_FLAGS_HAS_NEUTRAL = 2 ; # [doc = "Based on GIMBAL_DEVICE_CAP_FLAGS_HAS_ROLL_AXIS."] const GIMBAL_MANAGER_CAP_FLAGS_HAS_ROLL_AXIS = 4 ; # [doc = "Based on GIMBAL_DEVICE_CAP_FLAGS_HAS_ROLL_FOLLOW."] const GIMBAL_MANAGER_CAP_FLAGS_HAS_ROLL_FOLLOW = 8 ; # [doc = "Based on GIMBAL_DEVICE_CAP_FLAGS_HAS_ROLL_LOCK."] const GIMBAL_MANAGER_CAP_FLAGS_HAS_ROLL_LOCK = 16 ; # [doc = "Based on GIMBAL_DEVICE_CAP_FLAGS_HAS_PITCH_AXIS."] const GIMBAL_MANAGER_CAP_FLAGS_HAS_PITCH_AXIS = 32 ; # [doc = "Based on GIMBAL_DEVICE_CAP_FLAGS_HAS_PITCH_FOLLOW."] const GIMBAL_MANAGER_CAP_FLAGS_HAS_PITCH_FOLLOW = 64 ; # [doc = "Based on GIMBAL_DEVICE_CAP_FLAGS_HAS_PITCH_LOCK."] const GIMBAL_MANAGER_CAP_FLAGS_HAS_PITCH_LOCK = 128 ; # [doc = "Based on GIMBAL_DEVICE_CAP_FLAGS_HAS_YAW_AXIS."] const GIMBAL_MANAGER_CAP_FLAGS_HAS_YAW_AXIS = 256 ; # [doc = "Based on GIMBAL_DEVICE_CAP_FLAGS_HAS_YAW_FOLLOW."] const GIMBAL_MANAGER_CAP_FLAGS_HAS_YAW_FOLLOW = 512 ; # [doc = "Based on GIMBAL_DEVICE_CAP_FLAGS_HAS_YAW_LOCK."] const GIMBAL_MANAGER_CAP_FLAGS_HAS_YAW_LOCK = 1024 ; # [doc = "Based on GIMBAL_DEVICE_CAP_FLAGS_SUPPORTS_INFINITE_YAW."] const GIMBAL_MANAGER_CAP_FLAGS_SUPPORTS_INFINITE_YAW = 2048 ; # [doc = "Based on GIMBAL_DEVICE_CAP_FLAGS_SUPPORTS_YAW_IN_EARTH_FRAME."] const GIMBAL_MANAGER_CAP_FLAGS_SUPPORTS_YAW_IN_EARTH_FRAME = 4096 ; # [doc = "Based on GIMBAL_DEVICE_CAP_FLAGS_HAS_RC_INPUTS."] const GIMBAL_MANAGER_CAP_FLAGS_HAS_RC_INPUTS = 8192 ; # [doc = "Gimbal manager supports to point to a local position."] const GIMBAL_MANAGER_CAP_FLAGS_CAN_POINT_LOCATION_LOCAL = 65536 ; # [doc = "Gimbal manager supports to point to a global latitude, longitude, altitude position."] const GIMBAL_MANAGER_CAP_FLAGS_CAN_POINT_LOCATION_GLOBAL = 131072 ; } }
975impl GimbalManagerCapFlags {
976 pub const DEFAULT: Self = Self::GIMBAL_MANAGER_CAP_FLAGS_HAS_RETRACT;
977}
978impl Default for GimbalManagerCapFlags {
979 fn default() -> Self {
980 Self::DEFAULT
981 }
982}
983bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Flags for high level gimbal manager operation The first 16 bits are identical to the GIMBAL_DEVICE_FLAGS."] pub struct GimbalManagerFlags : u32 { # [doc = "Based on GIMBAL_DEVICE_FLAGS_RETRACT."] const GIMBAL_MANAGER_FLAGS_RETRACT = 1 ; # [doc = "Based on GIMBAL_DEVICE_FLAGS_NEUTRAL."] const GIMBAL_MANAGER_FLAGS_NEUTRAL = 2 ; # [doc = "Based on GIMBAL_DEVICE_FLAGS_ROLL_LOCK."] const GIMBAL_MANAGER_FLAGS_ROLL_LOCK = 4 ; # [doc = "Based on GIMBAL_DEVICE_FLAGS_PITCH_LOCK."] const GIMBAL_MANAGER_FLAGS_PITCH_LOCK = 8 ; # [doc = "Based on GIMBAL_DEVICE_FLAGS_YAW_LOCK."] const GIMBAL_MANAGER_FLAGS_YAW_LOCK = 16 ; # [doc = "Based on GIMBAL_DEVICE_FLAGS_YAW_IN_VEHICLE_FRAME."] const GIMBAL_MANAGER_FLAGS_YAW_IN_VEHICLE_FRAME = 32 ; # [doc = "Based on GIMBAL_DEVICE_FLAGS_YAW_IN_EARTH_FRAME."] const GIMBAL_MANAGER_FLAGS_YAW_IN_EARTH_FRAME = 64 ; # [doc = "Based on GIMBAL_DEVICE_FLAGS_ACCEPTS_YAW_IN_EARTH_FRAME."] const GIMBAL_MANAGER_FLAGS_ACCEPTS_YAW_IN_EARTH_FRAME = 128 ; # [doc = "Based on GIMBAL_DEVICE_FLAGS_RC_EXCLUSIVE."] const GIMBAL_MANAGER_FLAGS_RC_EXCLUSIVE = 256 ; # [doc = "Based on GIMBAL_DEVICE_FLAGS_RC_MIXED."] const GIMBAL_MANAGER_FLAGS_RC_MIXED = 512 ; } }
984impl GimbalManagerFlags {
985 pub const DEFAULT: Self = Self::GIMBAL_MANAGER_FLAGS_RETRACT;
986}
987impl Default for GimbalManagerFlags {
988 fn default() -> Self {
989 Self::DEFAULT
990 }
991}
992#[cfg_attr(feature = "ts", derive(TS))]
993#[cfg_attr(feature = "ts", ts(export))]
994#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
995#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
996#[cfg_attr(feature = "serde", serde(tag = "type"))]
997#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
998#[repr(u32)]
999#[doc = "Type of GPS fix"]
1000pub enum GpsFixType {
1001 #[doc = "No GPS connected"]
1002 GPS_FIX_TYPE_NO_GPS = 0,
1003 #[doc = "No position information, GPS is connected"]
1004 GPS_FIX_TYPE_NO_FIX = 1,
1005 #[doc = "2D position"]
1006 GPS_FIX_TYPE_2D_FIX = 2,
1007 #[doc = "3D position"]
1008 GPS_FIX_TYPE_3D_FIX = 3,
1009 #[doc = "DGPS/SBAS aided 3D position"]
1010 GPS_FIX_TYPE_DGPS = 4,
1011 #[doc = "RTK float, 3D position"]
1012 GPS_FIX_TYPE_RTK_FLOAT = 5,
1013 #[doc = "RTK Fixed, 3D position"]
1014 GPS_FIX_TYPE_RTK_FIXED = 6,
1015 #[doc = "Static fixed, typically used for base stations"]
1016 GPS_FIX_TYPE_STATIC = 7,
1017 #[doc = "PPP, 3D position."]
1018 GPS_FIX_TYPE_PPP = 8,
1019}
1020impl GpsFixType {
1021 pub const DEFAULT: Self = Self::GPS_FIX_TYPE_NO_GPS;
1022}
1023impl Default for GpsFixType {
1024 fn default() -> Self {
1025 Self::DEFAULT
1026 }
1027}
1028bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] pub struct GpsInputIgnoreFlags : u16 { # [doc = "ignore altitude field"] const GPS_INPUT_IGNORE_FLAG_ALT = 1 ; # [doc = "ignore hdop field"] const GPS_INPUT_IGNORE_FLAG_HDOP = 2 ; # [doc = "ignore vdop field"] const GPS_INPUT_IGNORE_FLAG_VDOP = 4 ; # [doc = "ignore horizontal velocity field (vn and ve)"] const GPS_INPUT_IGNORE_FLAG_VEL_HORIZ = 8 ; # [doc = "ignore vertical velocity field (vd)"] const GPS_INPUT_IGNORE_FLAG_VEL_VERT = 16 ; # [doc = "ignore speed accuracy field"] const GPS_INPUT_IGNORE_FLAG_SPEED_ACCURACY = 32 ; # [doc = "ignore horizontal accuracy field"] const GPS_INPUT_IGNORE_FLAG_HORIZONTAL_ACCURACY = 64 ; # [doc = "ignore vertical accuracy field"] const GPS_INPUT_IGNORE_FLAG_VERTICAL_ACCURACY = 128 ; } }
1029impl GpsInputIgnoreFlags {
1030 pub const DEFAULT: Self = Self::GPS_INPUT_IGNORE_FLAG_ALT;
1031}
1032impl Default for GpsInputIgnoreFlags {
1033 fn default() -> Self {
1034 Self::DEFAULT
1035 }
1036}
1037#[cfg_attr(feature = "ts", derive(TS))]
1038#[cfg_attr(feature = "ts", ts(export))]
1039#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1040#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1041#[cfg_attr(feature = "serde", serde(tag = "type"))]
1042#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1043#[repr(u32)]
1044#[doc = "Gripper actions."]
1045pub enum GripperActions {
1046 #[doc = "Gripper release cargo."]
1047 GRIPPER_ACTION_RELEASE = 0,
1048 #[doc = "Gripper grab onto cargo."]
1049 GRIPPER_ACTION_GRAB = 1,
1050}
1051impl GripperActions {
1052 pub const DEFAULT: Self = Self::GRIPPER_ACTION_RELEASE;
1053}
1054impl Default for GripperActions {
1055 fn default() -> Self {
1056 Self::DEFAULT
1057 }
1058}
1059bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Flags in the HIGHRES_IMU message indicate which fields have updated since the last message"] pub struct HighresImuUpdatedFlags : u16 { # [doc = "The value in the xacc field has been updated"] const HIGHRES_IMU_UPDATED_XACC = 1 ; # [doc = "The value in the yacc field has been updated"] const HIGHRES_IMU_UPDATED_YACC = 2 ; # [doc = "The value in the zacc field has been updated since"] const HIGHRES_IMU_UPDATED_ZACC = 4 ; # [doc = "The value in the xgyro field has been updated"] const HIGHRES_IMU_UPDATED_XGYRO = 8 ; # [doc = "The value in the ygyro field has been updated"] const HIGHRES_IMU_UPDATED_YGYRO = 16 ; # [doc = "The value in the zgyro field has been updated"] const HIGHRES_IMU_UPDATED_ZGYRO = 32 ; # [doc = "The value in the xmag field has been updated"] const HIGHRES_IMU_UPDATED_XMAG = 64 ; # [doc = "The value in the ymag field has been updated"] const HIGHRES_IMU_UPDATED_YMAG = 128 ; # [doc = "The value in the zmag field has been updated"] const HIGHRES_IMU_UPDATED_ZMAG = 256 ; # [doc = "The value in the abs_pressure field has been updated"] const HIGHRES_IMU_UPDATED_ABS_PRESSURE = 512 ; # [doc = "The value in the diff_pressure field has been updated"] const HIGHRES_IMU_UPDATED_DIFF_PRESSURE = 1024 ; # [doc = "The value in the pressure_alt field has been updated"] const HIGHRES_IMU_UPDATED_PRESSURE_ALT = 2048 ; # [doc = "The value in the temperature field has been updated"] const HIGHRES_IMU_UPDATED_TEMPERATURE = 4096 ; } }
1060impl HighresImuUpdatedFlags {
1061 pub const DEFAULT: Self = Self::HIGHRES_IMU_UPDATED_XACC;
1062}
1063impl Default for HighresImuUpdatedFlags {
1064 fn default() -> Self {
1065 Self::DEFAULT
1066 }
1067}
1068bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Flags used in HIL_ACTUATOR_CONTROLS message."] pub struct HilActuatorControlsFlags : u64 { # [doc = "Simulation is using lockstep"] const HIL_ACTUATOR_CONTROLS_FLAGS_LOCKSTEP = 1 ; } }
1069impl HilActuatorControlsFlags {
1070 pub const DEFAULT: Self = Self::HIL_ACTUATOR_CONTROLS_FLAGS_LOCKSTEP;
1071}
1072impl Default for HilActuatorControlsFlags {
1073 fn default() -> Self {
1074 Self::DEFAULT
1075 }
1076}
1077bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Flags in the HIL_SENSOR message indicate which fields have updated since the last message"] pub struct HilSensorUpdatedFlags : u32 { # [doc = "The value in the xacc field has been updated"] const HIL_SENSOR_UPDATED_XACC = 1 ; # [doc = "The value in the yacc field has been updated"] const HIL_SENSOR_UPDATED_YACC = 2 ; # [doc = "The value in the zacc field has been updated"] const HIL_SENSOR_UPDATED_ZACC = 4 ; # [doc = "The value in the xgyro field has been updated"] const HIL_SENSOR_UPDATED_XGYRO = 8 ; # [doc = "The value in the ygyro field has been updated"] const HIL_SENSOR_UPDATED_YGYRO = 16 ; # [doc = "The value in the zgyro field has been updated"] const HIL_SENSOR_UPDATED_ZGYRO = 32 ; # [doc = "The value in the xmag field has been updated"] const HIL_SENSOR_UPDATED_XMAG = 64 ; # [doc = "The value in the ymag field has been updated"] const HIL_SENSOR_UPDATED_YMAG = 128 ; # [doc = "The value in the zmag field has been updated"] const HIL_SENSOR_UPDATED_ZMAG = 256 ; # [doc = "The value in the abs_pressure field has been updated"] const HIL_SENSOR_UPDATED_ABS_PRESSURE = 512 ; # [doc = "The value in the diff_pressure field has been updated"] const HIL_SENSOR_UPDATED_DIFF_PRESSURE = 1024 ; # [doc = "The value in the pressure_alt field has been updated"] const HIL_SENSOR_UPDATED_PRESSURE_ALT = 2048 ; # [doc = "The value in the temperature field has been updated"] const HIL_SENSOR_UPDATED_TEMPERATURE = 4096 ; # [doc = "Full reset of attitude/position/velocities/etc was performed in sim (Bit 31)."] const HIL_SENSOR_UPDATED_RESET = 2147483648 ; } }
1078impl HilSensorUpdatedFlags {
1079 pub const DEFAULT: Self = Self::HIL_SENSOR_UPDATED_XACC;
1080}
1081impl Default for HilSensorUpdatedFlags {
1082 fn default() -> Self {
1083 Self::DEFAULT
1084 }
1085}
1086bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Flags to report failure cases over the high latency telemetry."] pub struct HlFailureFlag : u16 { # [doc = "GPS failure."] const HL_FAILURE_FLAG_GPS = 1 ; # [doc = "Differential pressure sensor failure."] const HL_FAILURE_FLAG_DIFFERENTIAL_PRESSURE = 2 ; # [doc = "Absolute pressure sensor failure."] const HL_FAILURE_FLAG_ABSOLUTE_PRESSURE = 4 ; # [doc = "Accelerometer sensor failure."] const HL_FAILURE_FLAG_3D_ACCEL = 8 ; # [doc = "Gyroscope sensor failure."] const HL_FAILURE_FLAG_3D_GYRO = 16 ; # [doc = "Magnetometer sensor failure."] const HL_FAILURE_FLAG_3D_MAG = 32 ; # [doc = "Terrain subsystem failure."] const HL_FAILURE_FLAG_TERRAIN = 64 ; # [doc = "Battery failure/critical low battery."] const HL_FAILURE_FLAG_BATTERY = 128 ; # [doc = "RC receiver failure/no RC connection."] const HL_FAILURE_FLAG_RC_RECEIVER = 256 ; # [doc = "Offboard link failure."] const HL_FAILURE_FLAG_OFFBOARD_LINK = 512 ; # [doc = "Engine failure."] const HL_FAILURE_FLAG_ENGINE = 1024 ; # [doc = "Geofence violation."] const HL_FAILURE_FLAG_GEOFENCE = 2048 ; # [doc = "Estimator failure, for example measurement rejection or large variances."] const HL_FAILURE_FLAG_ESTIMATOR = 4096 ; # [doc = "Mission failure."] const HL_FAILURE_FLAG_MISSION = 8192 ; } }
1087impl HlFailureFlag {
1088 pub const DEFAULT: Self = Self::HL_FAILURE_FLAG_GPS;
1089}
1090impl Default for HlFailureFlag {
1091 fn default() -> Self {
1092 Self::DEFAULT
1093 }
1094}
1095bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Illuminator module error flags (bitmap, 0 means no error)"] pub struct IlluminatorErrorFlags : u32 { # [doc = "Illuminator thermal throttling error."] const ILLUMINATOR_ERROR_FLAGS_THERMAL_THROTTLING = 1 ; # [doc = "Illuminator over temperature shutdown error."] const ILLUMINATOR_ERROR_FLAGS_OVER_TEMPERATURE_SHUTDOWN = 2 ; # [doc = "Illuminator thermistor failure."] const ILLUMINATOR_ERROR_FLAGS_THERMISTOR_FAILURE = 4 ; } }
1096impl IlluminatorErrorFlags {
1097 pub const DEFAULT: Self = Self::ILLUMINATOR_ERROR_FLAGS_THERMAL_THROTTLING;
1098}
1099impl Default for IlluminatorErrorFlags {
1100 fn default() -> Self {
1101 Self::DEFAULT
1102 }
1103}
1104#[cfg_attr(feature = "ts", derive(TS))]
1105#[cfg_attr(feature = "ts", ts(export))]
1106#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1107#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1108#[cfg_attr(feature = "serde", serde(tag = "type"))]
1109#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1110#[repr(u32)]
1111#[doc = "Modes of illuminator"]
1112pub enum IlluminatorMode {
1113 #[doc = "Illuminator mode is not specified/unknown"]
1114 ILLUMINATOR_MODE_UNKNOWN = 0,
1115 #[doc = "Illuminator behavior is controlled by MAV_CMD_DO_ILLUMINATOR_CONFIGURE settings"]
1116 ILLUMINATOR_MODE_INTERNAL_CONTROL = 1,
1117 #[doc = "Illuminator behavior is controlled by external factors: e.g. an external hardware signal"]
1118 ILLUMINATOR_MODE_EXTERNAL_SYNC = 2,
1119}
1120impl IlluminatorMode {
1121 pub const DEFAULT: Self = Self::ILLUMINATOR_MODE_UNKNOWN;
1122}
1123impl Default for IlluminatorMode {
1124 fn default() -> Self {
1125 Self::DEFAULT
1126 }
1127}
1128#[cfg_attr(feature = "ts", derive(TS))]
1129#[cfg_attr(feature = "ts", ts(export))]
1130#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1131#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1132#[cfg_attr(feature = "serde", serde(tag = "type"))]
1133#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1134#[repr(u32)]
1135#[doc = "Type of landing target"]
1136pub enum LandingTargetType {
1137 #[doc = "Landing target signaled by light beacon (ex: IR-LOCK)"]
1138 LANDING_TARGET_TYPE_LIGHT_BEACON = 0,
1139 #[doc = "Landing target signaled by radio beacon (ex: ILS, NDB)"]
1140 LANDING_TARGET_TYPE_RADIO_BEACON = 1,
1141 #[doc = "Landing target represented by a fiducial marker (ex: ARTag)"]
1142 LANDING_TARGET_TYPE_VISION_FIDUCIAL = 2,
1143 #[doc = "Landing target represented by a pre-defined visual shape/feature (ex: X-marker, H-marker, square)"]
1144 LANDING_TARGET_TYPE_VISION_OTHER = 3,
1145}
1146impl LandingTargetType {
1147 pub const DEFAULT: Self = Self::LANDING_TARGET_TYPE_LIGHT_BEACON;
1148}
1149impl Default for LandingTargetType {
1150 fn default() -> Self {
1151 Self::DEFAULT
1152 }
1153}
1154#[cfg_attr(feature = "ts", derive(TS))]
1155#[cfg_attr(feature = "ts", ts(export))]
1156#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1157#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1158#[cfg_attr(feature = "serde", serde(tag = "type"))]
1159#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1160#[repr(u32)]
1161pub enum MagCalStatus {
1162 MAG_CAL_NOT_STARTED = 0,
1163 MAG_CAL_WAITING_TO_START = 1,
1164 MAG_CAL_RUNNING_STEP_ONE = 2,
1165 MAG_CAL_RUNNING_STEP_TWO = 3,
1166 MAG_CAL_SUCCESS = 4,
1167 MAG_CAL_FAILED = 5,
1168 MAG_CAL_BAD_ORIENTATION = 6,
1169 MAG_CAL_BAD_RADIUS = 7,
1170}
1171impl MagCalStatus {
1172 pub const DEFAULT: Self = Self::MAG_CAL_NOT_STARTED;
1173}
1174impl Default for MagCalStatus {
1175 fn default() -> Self {
1176 Self::DEFAULT
1177 }
1178}
1179#[cfg_attr(feature = "ts", derive(TS))]
1180#[cfg_attr(feature = "ts", ts(export))]
1181#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1182#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1183#[cfg_attr(feature = "serde", serde(tag = "type"))]
1184#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1185#[repr(u32)]
1186pub enum MavArmAuthDeniedReason {
1187 #[doc = "Not a specific reason"]
1188 MAV_ARM_AUTH_DENIED_REASON_GENERIC = 0,
1189 #[doc = "Authorizer will send the error as string to GCS"]
1190 MAV_ARM_AUTH_DENIED_REASON_NONE = 1,
1191 #[doc = "At least one waypoint have a invalid value"]
1192 MAV_ARM_AUTH_DENIED_REASON_INVALID_WAYPOINT = 2,
1193 #[doc = "Timeout in the authorizer process(in case it depends on network)"]
1194 MAV_ARM_AUTH_DENIED_REASON_TIMEOUT = 3,
1195 #[doc = "Airspace of the mission in use by another vehicle, second result parameter can have the waypoint id that caused it to be denied."]
1196 MAV_ARM_AUTH_DENIED_REASON_AIRSPACE_IN_USE = 4,
1197 #[doc = "Weather is not good to fly"]
1198 MAV_ARM_AUTH_DENIED_REASON_BAD_WEATHER = 5,
1199}
1200impl MavArmAuthDeniedReason {
1201 pub const DEFAULT: Self = Self::MAV_ARM_AUTH_DENIED_REASON_GENERIC;
1202}
1203impl Default for MavArmAuthDeniedReason {
1204 fn default() -> Self {
1205 Self::DEFAULT
1206 }
1207}
1208#[cfg_attr(feature = "ts", derive(TS))]
1209#[cfg_attr(feature = "ts", ts(export))]
1210#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1211#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1212#[cfg_attr(feature = "serde", serde(tag = "type"))]
1213#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1214#[repr(u32)]
1215#[doc = "Micro air vehicle / autopilot classes. This identifies the individual model."]
1216pub enum MavAutopilot {
1217 #[doc = "Generic autopilot, full support for everything"]
1218 MAV_AUTOPILOT_GENERIC = 0,
1219 #[doc = "Reserved for future use."]
1220 MAV_AUTOPILOT_RESERVED = 1,
1221 #[doc = "SLUGS autopilot, <http://slugsuav.soe.ucsc.edu>"]
1222 MAV_AUTOPILOT_SLUGS = 2,
1223 #[doc = "ArduPilot - Plane/Copter/Rover/Sub/Tracker, <https://ardupilot.org>"]
1224 MAV_AUTOPILOT_ARDUPILOTMEGA = 3,
1225 #[doc = "OpenPilot, <http://openpilot.org>"]
1226 MAV_AUTOPILOT_OPENPILOT = 4,
1227 #[doc = "Generic autopilot only supporting simple waypoints"]
1228 MAV_AUTOPILOT_GENERIC_WAYPOINTS_ONLY = 5,
1229 #[doc = "Generic autopilot supporting waypoints and other simple navigation commands"]
1230 MAV_AUTOPILOT_GENERIC_WAYPOINTS_AND_SIMPLE_NAVIGATION_ONLY = 6,
1231 #[doc = "Generic autopilot supporting the full mission command set"]
1232 MAV_AUTOPILOT_GENERIC_MISSION_FULL = 7,
1233 #[doc = "No valid autopilot, e.g. a GCS or other MAVLink component"]
1234 MAV_AUTOPILOT_INVALID = 8,
1235 #[doc = "PPZ UAV - <http://nongnu.org/paparazzi>"]
1236 MAV_AUTOPILOT_PPZ = 9,
1237 #[doc = "UAV Dev Board"]
1238 MAV_AUTOPILOT_UDB = 10,
1239 #[doc = "FlexiPilot"]
1240 MAV_AUTOPILOT_FP = 11,
1241 #[doc = "PX4 Autopilot - <http://px4.io/>"]
1242 MAV_AUTOPILOT_PX4 = 12,
1243 #[doc = "SMACCMPilot - <http://smaccmpilot.org>"]
1244 MAV_AUTOPILOT_SMACCMPILOT = 13,
1245 #[doc = "AutoQuad -- <http://autoquad.org>"]
1246 MAV_AUTOPILOT_AUTOQUAD = 14,
1247 #[doc = "Armazila -- <http://armazila.com>"]
1248 MAV_AUTOPILOT_ARMAZILA = 15,
1249 #[doc = "Aerob -- <http://aerob.ru>"]
1250 MAV_AUTOPILOT_AEROB = 16,
1251 #[doc = "ASLUAV autopilot -- <http://www.asl.ethz.ch>"]
1252 MAV_AUTOPILOT_ASLUAV = 17,
1253 #[doc = "SmartAP Autopilot - <http://sky-drones.com>"]
1254 MAV_AUTOPILOT_SMARTAP = 18,
1255 #[doc = "AirRails - <http://uaventure.com>"]
1256 MAV_AUTOPILOT_AIRRAILS = 19,
1257 #[doc = "Fusion Reflex - <https://fusion.engineering>"]
1258 MAV_AUTOPILOT_REFLEX = 20,
1259}
1260impl MavAutopilot {
1261 pub const DEFAULT: Self = Self::MAV_AUTOPILOT_GENERIC;
1262}
1263impl Default for MavAutopilot {
1264 fn default() -> Self {
1265 Self::DEFAULT
1266 }
1267}
1268#[cfg_attr(feature = "ts", derive(TS))]
1269#[cfg_attr(feature = "ts", ts(export))]
1270#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1271#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1272#[cfg_attr(feature = "serde", serde(tag = "type"))]
1273#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1274#[repr(u32)]
1275#[doc = "Enumeration for battery charge states."]
1276pub enum MavBatteryChargeState {
1277 #[doc = "Low battery state is not provided"]
1278 MAV_BATTERY_CHARGE_STATE_UNDEFINED = 0,
1279 #[doc = "Battery is not in low state. Normal operation."]
1280 MAV_BATTERY_CHARGE_STATE_OK = 1,
1281 #[doc = "Battery state is low, warn and monitor close."]
1282 MAV_BATTERY_CHARGE_STATE_LOW = 2,
1283 #[doc = "Battery state is critical, return or abort immediately."]
1284 MAV_BATTERY_CHARGE_STATE_CRITICAL = 3,
1285 #[doc = "Battery state is too low for ordinary abort sequence. Perform fastest possible emergency stop to prevent damage."]
1286 MAV_BATTERY_CHARGE_STATE_EMERGENCY = 4,
1287 #[doc = "Battery failed, damage unavoidable. Possible causes (faults) are listed in MAV_BATTERY_FAULT."]
1288 MAV_BATTERY_CHARGE_STATE_FAILED = 5,
1289 #[doc = "Battery is diagnosed to be defective or an error occurred, usage is discouraged / prohibited. Possible causes (faults) are listed in MAV_BATTERY_FAULT."]
1290 MAV_BATTERY_CHARGE_STATE_UNHEALTHY = 6,
1291 #[doc = "Battery is charging."]
1292 MAV_BATTERY_CHARGE_STATE_CHARGING = 7,
1293}
1294impl MavBatteryChargeState {
1295 pub const DEFAULT: Self = Self::MAV_BATTERY_CHARGE_STATE_UNDEFINED;
1296}
1297impl Default for MavBatteryChargeState {
1298 fn default() -> Self {
1299 Self::DEFAULT
1300 }
1301}
1302bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Smart battery supply status/fault flags (bitmask) for health indication. The battery must also report either MAV_BATTERY_CHARGE_STATE_FAILED or MAV_BATTERY_CHARGE_STATE_UNHEALTHY if any of these are set."] pub struct MavBatteryFault : u32 { # [doc = "Battery has deep discharged."] const MAV_BATTERY_FAULT_DEEP_DISCHARGE = 1 ; # [doc = "Voltage spikes."] const MAV_BATTERY_FAULT_SPIKES = 2 ; # [doc = "One or more cells have failed. Battery should also report MAV_BATTERY_CHARGE_STATE_FAILE (and should not be used)."] const MAV_BATTERY_FAULT_CELL_FAIL = 4 ; # [doc = "Over-current fault."] const MAV_BATTERY_FAULT_OVER_CURRENT = 8 ; # [doc = "Over-temperature fault."] const MAV_BATTERY_FAULT_OVER_TEMPERATURE = 16 ; # [doc = "Under-temperature fault."] const MAV_BATTERY_FAULT_UNDER_TEMPERATURE = 32 ; # [doc = "Vehicle voltage is not compatible with this battery (batteries on same power rail should have similar voltage)."] const MAV_BATTERY_FAULT_INCOMPATIBLE_VOLTAGE = 64 ; # [doc = "Battery firmware is not compatible with current autopilot firmware."] const MAV_BATTERY_FAULT_INCOMPATIBLE_FIRMWARE = 128 ; # [doc = "Battery is not compatible due to cell configuration (e.g. 5s1p when vehicle requires 6s)."] const BATTERY_FAULT_INCOMPATIBLE_CELLS_CONFIGURATION = 256 ; } }
1303impl MavBatteryFault {
1304 pub const DEFAULT: Self = Self::MAV_BATTERY_FAULT_DEEP_DISCHARGE;
1305}
1306impl Default for MavBatteryFault {
1307 fn default() -> Self {
1308 Self::DEFAULT
1309 }
1310}
1311#[cfg_attr(feature = "ts", derive(TS))]
1312#[cfg_attr(feature = "ts", ts(export))]
1313#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1314#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1315#[cfg_attr(feature = "serde", serde(tag = "type"))]
1316#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1317#[repr(u32)]
1318#[doc = "Enumeration of battery functions"]
1319pub enum MavBatteryFunction {
1320 #[doc = "Battery function is unknown"]
1321 MAV_BATTERY_FUNCTION_UNKNOWN = 0,
1322 #[doc = "Battery supports all flight systems"]
1323 MAV_BATTERY_FUNCTION_ALL = 1,
1324 #[doc = "Battery for the propulsion system"]
1325 MAV_BATTERY_FUNCTION_PROPULSION = 2,
1326 #[doc = "Avionics battery"]
1327 MAV_BATTERY_FUNCTION_AVIONICS = 3,
1328 #[doc = "Payload battery"]
1329 MAV_BATTERY_FUNCTION_PAYLOAD = 4,
1330}
1331impl MavBatteryFunction {
1332 pub const DEFAULT: Self = Self::MAV_BATTERY_FUNCTION_UNKNOWN;
1333}
1334impl Default for MavBatteryFunction {
1335 fn default() -> Self {
1336 Self::DEFAULT
1337 }
1338}
1339#[cfg_attr(feature = "ts", derive(TS))]
1340#[cfg_attr(feature = "ts", ts(export))]
1341#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1342#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1343#[cfg_attr(feature = "serde", serde(tag = "type"))]
1344#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1345#[repr(u32)]
1346#[doc = "Battery mode. Note, the normal operation mode (i.e. when flying) should be reported as MAV_BATTERY_MODE_UNKNOWN to allow message trimming in normal flight."]
1347pub enum MavBatteryMode {
1348 #[doc = "Battery mode not supported/unknown battery mode/normal operation."]
1349 MAV_BATTERY_MODE_UNKNOWN = 0,
1350 #[doc = "Battery is auto discharging (towards storage level)."]
1351 MAV_BATTERY_MODE_AUTO_DISCHARGING = 1,
1352 #[doc = "Battery in hot-swap mode (current limited to prevent spikes that might damage sensitive electrical circuits)."]
1353 MAV_BATTERY_MODE_HOT_SWAP = 2,
1354}
1355impl MavBatteryMode {
1356 pub const DEFAULT: Self = Self::MAV_BATTERY_MODE_UNKNOWN;
1357}
1358impl Default for MavBatteryMode {
1359 fn default() -> Self {
1360 Self::DEFAULT
1361 }
1362}
1363#[cfg_attr(feature = "ts", derive(TS))]
1364#[cfg_attr(feature = "ts", ts(export))]
1365#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1366#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1367#[cfg_attr(feature = "serde", serde(tag = "type"))]
1368#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1369#[repr(u32)]
1370#[doc = "Enumeration of battery types"]
1371pub enum MavBatteryType {
1372 #[doc = "Not specified."]
1373 MAV_BATTERY_TYPE_UNKNOWN = 0,
1374 #[doc = "Lithium polymer battery"]
1375 MAV_BATTERY_TYPE_LIPO = 1,
1376 #[doc = "Lithium-iron-phosphate battery"]
1377 MAV_BATTERY_TYPE_LIFE = 2,
1378 #[doc = "Lithium-ION battery"]
1379 MAV_BATTERY_TYPE_LION = 3,
1380 #[doc = "Nickel metal hydride battery"]
1381 MAV_BATTERY_TYPE_NIMH = 4,
1382}
1383impl MavBatteryType {
1384 pub const DEFAULT: Self = Self::MAV_BATTERY_TYPE_UNKNOWN;
1385}
1386impl Default for MavBatteryType {
1387 fn default() -> Self {
1388 Self::DEFAULT
1389 }
1390}
1391#[cfg_attr(feature = "ts", derive(TS))]
1392#[cfg_attr(feature = "ts", ts(export))]
1393#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1394#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1395#[cfg_attr(feature = "serde", serde(tag = "type"))]
1396#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1397#[repr(u32)]
1398#[doc = "Commands to be executed by the MAV. They can be executed on user request, or as part of a mission script. If the action is used in a mission, the parameter mapping to the waypoint/mission message is as follows: Param 1, Param 2, Param 3, Param 4, X: Param 5, Y:Param 6, Z:Param 7. This command list is similar what ARINC 424 is for commercial aircraft: A data format how to interpret waypoint/mission data. NaN and INT32_MAX may be used in float/integer params (respectively) to indicate optional/default values (e.g. to use the component's current yaw or latitude rather than a specific value). See <https://mavlink.io/en/guide/xml_schema.html#MAV_CMD> for information about the structure of the MAV_CMD entries"]
1399pub enum MavCmd {
1400 #[doc = "Navigate to waypoint. This is intended for use in missions (for guided commands outside of missions use MAV_CMD_DO_REPOSITION)."]
1401 MAV_CMD_NAV_WAYPOINT = 16,
1402 #[doc = "Loiter around this waypoint an unlimited amount of time"]
1403 MAV_CMD_NAV_LOITER_UNLIM = 17,
1404 #[doc = "Loiter around this waypoint for X turns"]
1405 MAV_CMD_NAV_LOITER_TURNS = 18,
1406 #[doc = "Loiter at the specified latitude, longitude and altitude for a certain amount of time. Multicopter vehicles stop at the point (within a vehicle-specific acceptance radius). Forward-only moving vehicles (e.g. fixed-wing) circle the point with the specified radius/direction. If the Heading Required parameter (2) is non-zero forward moving aircraft will only leave the loiter circle once heading towards the next waypoint."]
1407 MAV_CMD_NAV_LOITER_TIME = 19,
1408 #[doc = "Return to launch location"]
1409 MAV_CMD_NAV_RETURN_TO_LAUNCH = 20,
1410 #[doc = "Land at location."]
1411 MAV_CMD_NAV_LAND = 21,
1412 #[doc = "Takeoff from ground / hand. Vehicles that support multiple takeoff modes (e.g. VTOL quadplane) should take off using the currently configured mode."]
1413 MAV_CMD_NAV_TAKEOFF = 22,
1414 #[doc = "Land at local position (local frame only)"]
1415 MAV_CMD_NAV_LAND_LOCAL = 23,
1416 #[doc = "Takeoff from local position (local frame only)"]
1417 MAV_CMD_NAV_TAKEOFF_LOCAL = 24,
1418 #[doc = "Vehicle following, i.e. this waypoint represents the position of a moving vehicle"]
1419 MAV_CMD_NAV_FOLLOW = 25,
1420 #[doc = "Continue on the current course and climb/descend to specified altitude. When the altitude is reached continue to the next command (i.e., don't proceed to the next command until the desired altitude is reached."]
1421 MAV_CMD_NAV_CONTINUE_AND_CHANGE_ALT = 30,
1422 #[doc = "Begin loiter at the specified Latitude and Longitude. If Lat=Lon=0, then loiter at the current position. Don't consider the navigation command complete (don't leave loiter) until the altitude has been reached. Additionally, if the Heading Required parameter is non-zero the aircraft will not leave the loiter until heading toward the next waypoint."]
1423 MAV_CMD_NAV_LOITER_TO_ALT = 31,
1424 #[doc = "Begin following a target"]
1425 MAV_CMD_DO_FOLLOW = 32,
1426 #[doc = "Reposition the MAV after a follow target command has been sent"]
1427 MAV_CMD_DO_FOLLOW_REPOSITION = 33,
1428 #[doc = "Start orbiting on the circumference of a circle defined by the parameters. Setting values to NaN/INT32_MAX (as appropriate) results in using defaults."]
1429 MAV_CMD_DO_ORBIT = 34,
1430 #[deprecated = " See `MAV_CMD_DO_SET_ROI_*` (Deprecated since 2018-01)"]
1431 #[doc = "Sets the region of interest (ROI) for a sensor set or the vehicle itself. This can then be used by the vehicle's control system to control the vehicle attitude and the attitude of various sensors such as cameras."]
1432 MAV_CMD_NAV_ROI = 80,
1433 #[doc = "Control autonomous path planning on the MAV."]
1434 MAV_CMD_NAV_PATHPLANNING = 81,
1435 #[doc = "Navigate to waypoint using a spline path."]
1436 MAV_CMD_NAV_SPLINE_WAYPOINT = 82,
1437 #[doc = "Takeoff from ground using VTOL mode, and transition to forward flight with specified heading. The command should be ignored by vehicles that dont support both VTOL and fixed-wing flight (multicopters, boats,etc.)."]
1438 MAV_CMD_NAV_VTOL_TAKEOFF = 84,
1439 #[doc = "Land using VTOL mode"]
1440 MAV_CMD_NAV_VTOL_LAND = 85,
1441 #[doc = "hand control over to an external controller"]
1442 MAV_CMD_NAV_GUIDED_ENABLE = 92,
1443 #[doc = "Delay the next navigation command a number of seconds or until a specified time"]
1444 MAV_CMD_NAV_DELAY = 93,
1445 #[doc = "Descend and place payload. Vehicle moves to specified location, descends until it detects a hanging payload has reached the ground, and then releases the payload. If ground is not detected before the reaching the maximum descent value (param1), the command will complete without releasing the payload."]
1446 MAV_CMD_NAV_PAYLOAD_PLACE = 94,
1447 #[doc = "NOP - This command is only used to mark the upper limit of the NAV/ACTION commands in the enumeration"]
1448 MAV_CMD_NAV_LAST = 95,
1449 #[doc = "Delay mission state machine."]
1450 MAV_CMD_CONDITION_DELAY = 112,
1451 #[doc = "Ascend/descend to target altitude at specified rate. Delay mission state machine until desired altitude reached."]
1452 MAV_CMD_CONDITION_CHANGE_ALT = 113,
1453 #[doc = "Delay mission state machine until within desired distance of next NAV point."]
1454 MAV_CMD_CONDITION_DISTANCE = 114,
1455 #[doc = "Reach a certain target angle."]
1456 MAV_CMD_CONDITION_YAW = 115,
1457 #[doc = "NOP - This command is only used to mark the upper limit of the CONDITION commands in the enumeration"]
1458 MAV_CMD_CONDITION_LAST = 159,
1459 #[doc = "Set system mode."]
1460 MAV_CMD_DO_SET_MODE = 176,
1461 #[doc = "Jump to the desired command in the mission list. Repeat this action only the specified number of times"]
1462 MAV_CMD_DO_JUMP = 177,
1463 #[doc = "Change speed and/or throttle set points. The value persists until it is overridden or there is a mode change"]
1464 MAV_CMD_DO_CHANGE_SPEED = 178,
1465 #[doc = "Sets the home position to either to the current position or a specified position. The home position is the default position that the system will return to and land on. The position is set automatically by the system during the takeoff (and may also be set using this command). Note: the current home position may be emitted in a HOME_POSITION message on request (using MAV_CMD_REQUEST_MESSAGE with param1=242)."]
1466 MAV_CMD_DO_SET_HOME = 179,
1467 #[deprecated = " See `PARAM_SET` (Deprecated since 2024-04)"]
1468 #[doc = "Set a system parameter. Caution! Use of this command requires knowledge of the numeric enumeration value of the parameter."]
1469 MAV_CMD_DO_SET_PARAMETER = 180,
1470 #[doc = "Set a relay to a condition."]
1471 MAV_CMD_DO_SET_RELAY = 181,
1472 #[doc = "Cycle a relay on and off for a desired number of cycles with a desired period."]
1473 MAV_CMD_DO_REPEAT_RELAY = 182,
1474 #[doc = "Set a servo to a desired PWM value."]
1475 MAV_CMD_DO_SET_SERVO = 183,
1476 #[doc = "Cycle a between its nominal setting and a desired PWM for a desired number of cycles with a desired period."]
1477 MAV_CMD_DO_REPEAT_SERVO = 184,
1478 #[doc = "0.5); the ACK should be either MAV_RESULT_FAILED or MAV_RESULT_UNSUPPORTED."]
1479 MAV_CMD_DO_FLIGHTTERMINATION = 185,
1480 #[doc = "Change altitude set point."]
1481 MAV_CMD_DO_CHANGE_ALTITUDE = 186,
1482 #[doc = "Sets actuators (e.g. servos) to a desired value. The actuator numbers are mapped to specific outputs (e.g. on any MAIN or AUX PWM or UAVCAN) using a flight-stack specific mechanism (i.e. a parameter)."]
1483 MAV_CMD_DO_SET_ACTUATOR = 187,
1484 #[doc = "Mission item to specify the start of a failsafe/landing return-path segment (the end of the segment is the next MAV_CMD_DO_LAND_START item). A vehicle that is using missions for landing (e.g. in a return mode) will join the mission on the closest path of the return-path segment (instead of MAV_CMD_DO_LAND_START or the nearest waypoint). The main use case is to minimize the failsafe flight path in corridor missions, where the inbound/outbound paths are constrained (by geofences) to the same particular path. The MAV_CMD_NAV_RETURN_PATH_START would be placed at the start of the return path. If a failsafe occurs on the outbound path the vehicle will move to the nearest point on the return path (which is parallel for this kind of mission), effectively turning round and following the shortest path to landing. If a failsafe occurs on the inbound path the vehicle is already on the return segment and will continue to landing. The Latitude/Longitude/Altitude are optional, and may be set to 0 if not needed. If specified, the item defines the waypoint at which the return segment starts. If sent using as a command, the vehicle will perform a mission landing (using the land segment if defined) or reject the command if mission landings are not supported, or no mission landing is defined. When used as a command any position information in the command is ignored."]
1485 MAV_CMD_DO_RETURN_PATH_START = 188,
1486 #[doc = "Mission item to mark the start of a mission landing pattern, or a command to land with a mission landing pattern. When used in a mission, this is a marker for the start of a sequence of mission items that represent a landing pattern. It should be followed by a navigation item that defines the first waypoint of the landing sequence. The start marker positional params are used only for selecting what landing pattern to use if several are defined in the mission (the selected pattern will be the one with the marker position that is closest to the vehicle when a landing is commanded). If the marker item position has zero-values for latitude, longitude, and altitude, then landing pattern selection is instead based on the position of the first waypoint in the landing sequence. \t When sent as a command it triggers a landing using a mission landing pattern. \t The location parameters are not used in this case, and should be set to 0."]
1487 MAV_CMD_DO_LAND_START = 189,
1488 #[doc = "Mission command to perform a landing from a rally point."]
1489 MAV_CMD_DO_RALLY_LAND = 190,
1490 #[doc = "Mission command to safely abort an autonomous landing."]
1491 MAV_CMD_DO_GO_AROUND = 191,
1492 #[doc = "Reposition the vehicle to a specific WGS84 global position. This command is intended for guided commands (for missions use MAV_CMD_NAV_WAYPOINT instead)."]
1493 MAV_CMD_DO_REPOSITION = 192,
1494 #[doc = "If in a GPS controlled position mode, hold the current position or continue."]
1495 MAV_CMD_DO_PAUSE_CONTINUE = 193,
1496 #[doc = "Set moving direction to forward or reverse."]
1497 MAV_CMD_DO_SET_REVERSE = 194,
1498 #[doc = "Sets the region of interest (ROI) to a location. This can then be used by the vehicle's control system to control the vehicle attitude and the attitude of various sensors such as cameras. This command can be sent to a gimbal manager but not to a gimbal device. A gimbal is not to react to this message."]
1499 MAV_CMD_DO_SET_ROI_LOCATION = 195,
1500 #[doc = "Sets the region of interest (ROI) to be toward next waypoint, with optional pitch/roll/yaw offset. This can then be used by the vehicle's control system to control the vehicle attitude and the attitude of various sensors such as cameras. This command can be sent to a gimbal manager but not to a gimbal device. A gimbal device is not to react to this message."]
1501 MAV_CMD_DO_SET_ROI_WPNEXT_OFFSET = 196,
1502 #[doc = "Cancels any previous ROI command returning the vehicle/sensors to default flight characteristics. This can then be used by the vehicle's control system to control the vehicle attitude and the attitude of various sensors such as cameras. This command can be sent to a gimbal manager but not to a gimbal device. A gimbal device is not to react to this message. After this command the gimbal manager should go back to manual input if available, and otherwise assume a neutral position."]
1503 MAV_CMD_DO_SET_ROI_NONE = 197,
1504 #[doc = "Mount tracks system with specified system ID. Determination of target vehicle position may be done with GLOBAL_POSITION_INT or any other means. This command can be sent to a gimbal manager but not to a gimbal device. A gimbal device is not to react to this message."]
1505 MAV_CMD_DO_SET_ROI_SYSID = 198,
1506 #[doc = "Control onboard camera system."]
1507 MAV_CMD_DO_CONTROL_VIDEO = 200,
1508 #[deprecated = " See `MAV_CMD_DO_SET_ROI_*` (Deprecated since 2018-01)"]
1509 #[doc = "Sets the region of interest (ROI) for a sensor set or the vehicle itself. This can then be used by the vehicle's control system to control the vehicle attitude and the attitude of various sensors such as cameras."]
1510 MAV_CMD_DO_SET_ROI = 201,
1511 #[doc = "Configure digital camera. This is a fallback message for systems that have not yet implemented PARAM_EXT_XXX messages and camera definition files (see <https://mavlink.io/en/services/camera_def.html> )."]
1512 MAV_CMD_DO_DIGICAM_CONFIGURE = 202,
1513 #[doc = "Control digital camera. This is a fallback message for systems that have not yet implemented PARAM_EXT_XXX messages and camera definition files (see <https://mavlink.io/en/services/camera_def.html> )."]
1514 MAV_CMD_DO_DIGICAM_CONTROL = 203,
1515 #[deprecated = "This message has been superseded by MAV_CMD_DO_GIMBAL_MANAGER_CONFIGURE. The message can still be used to communicate with legacy gimbals implementing it. See `MAV_CMD_DO_GIMBAL_MANAGER_CONFIGURE` (Deprecated since 2020-01)"]
1516 #[doc = "Mission command to configure a camera or antenna mount"]
1517 MAV_CMD_DO_MOUNT_CONFIGURE = 204,
1518 #[deprecated = "This message is ambiguous and inconsistent. It has been superseded by MAV_CMD_DO_GIMBAL_MANAGER_PITCHYAW and `MAV_CMD_DO_SET_ROI_*` variants. The message can still be used to communicate with legacy gimbals implementing it. See `MAV_CMD_DO_GIMBAL_MANAGER_PITCHYAW` (Deprecated since 2020-01)"]
1519 #[doc = "Mission command to control a camera or antenna mount"]
1520 MAV_CMD_DO_MOUNT_CONTROL = 205,
1521 #[doc = "Mission command to set camera trigger distance for this flight. The camera is triggered each time this distance is exceeded. This command can also be used to set the shutter integration time for the camera."]
1522 MAV_CMD_DO_SET_CAM_TRIGG_DIST = 206,
1523 #[doc = "Enable the geofence. This can be used in a mission or via the command protocol. The persistence/lifetime of the setting is undefined. Depending on flight stack implementation it may persist until superseded, or it may revert to a system default at the end of a mission. Flight stacks typically reset the setting to system defaults on reboot."]
1524 MAV_CMD_DO_FENCE_ENABLE = 207,
1525 #[doc = "Mission item/command to release a parachute or enable/disable auto release."]
1526 MAV_CMD_DO_PARACHUTE = 208,
1527 #[doc = "Command to perform motor test."]
1528 MAV_CMD_DO_MOTOR_TEST = 209,
1529 #[doc = "Change to/from inverted flight."]
1530 MAV_CMD_DO_INVERTED_FLIGHT = 210,
1531 #[doc = "Mission command to operate a gripper."]
1532 MAV_CMD_DO_GRIPPER = 211,
1533 #[doc = "Enable/disable autotune."]
1534 MAV_CMD_DO_AUTOTUNE_ENABLE = 212,
1535 #[doc = "Sets a desired vehicle turn angle and speed change."]
1536 MAV_CMD_NAV_SET_YAW_SPEED = 213,
1537 #[doc = "Mission command to set camera trigger interval for this flight. If triggering is enabled, the camera is triggered each time this interval expires. This command can also be used to set the shutter integration time for the camera."]
1538 MAV_CMD_DO_SET_CAM_TRIGG_INTERVAL = 214,
1539 #[deprecated = " See `MAV_CMD_DO_GIMBAL_MANAGER_PITCHYAW` (Deprecated since 2020-01)"]
1540 #[doc = "Mission command to control a camera or antenna mount, using a quaternion as reference."]
1541 MAV_CMD_DO_MOUNT_CONTROL_QUAT = 220,
1542 #[doc = "set id of master controller"]
1543 MAV_CMD_DO_GUIDED_MASTER = 221,
1544 #[doc = "Set limits for external control"]
1545 MAV_CMD_DO_GUIDED_LIMITS = 222,
1546 #[doc = "Control vehicle engine. This is interpreted by the vehicles engine controller to change the target engine state. It is intended for vehicles with internal combustion engines"]
1547 MAV_CMD_DO_ENGINE_CONTROL = 223,
1548 #[doc = "Set the mission item with sequence number seq as the current item and emit MISSION_CURRENT (whether or not the mission number changed). If a mission is currently being executed, the system will continue to this new mission item on the shortest path, skipping any intermediate mission items. \t Note that mission jump repeat counters are not reset unless param2 is set (see MAV_CMD_DO_JUMP param2). This command may trigger a mission state-machine change on some systems: for example from MISSION_STATE_NOT_STARTED or MISSION_STATE_PAUSED to MISSION_STATE_ACTIVE. If the system is in mission mode, on those systems this command might therefore start, restart or resume the mission. If the system is not in mission mode this command must not trigger a switch to mission mode. The mission may be \"reset\" using param2. Resetting sets jump counters to initial values (to reset counters without changing the current mission item set the param1 to `-1`). Resetting also explicitly changes a mission state of MISSION_STATE_COMPLETE to MISSION_STATE_PAUSED or MISSION_STATE_ACTIVE, potentially allowing it to resume when it is (next) in a mission mode. \t The command will ACK with MAV_RESULT_FAILED if the sequence number is out of range (including if there is no mission item)."]
1549 MAV_CMD_DO_SET_MISSION_CURRENT = 224,
1550 #[doc = "NOP - This command is only used to mark the upper limit of the DO commands in the enumeration"]
1551 MAV_CMD_DO_LAST = 240,
1552 #[doc = "Trigger calibration. This command will be only accepted if in pre-flight mode. Except for Temperature Calibration, only one sensor should be set in a single message and all others should be zero."]
1553 MAV_CMD_PREFLIGHT_CALIBRATION = 241,
1554 #[doc = "Set sensor offsets. This command will be only accepted if in pre-flight mode."]
1555 MAV_CMD_PREFLIGHT_SET_SENSOR_OFFSETS = 242,
1556 #[doc = "Trigger UAVCAN configuration (actuator ID assignment and direction mapping). Note that this maps to the legacy UAVCAN v0 function UAVCAN_ENUMERATE, which is intended to be executed just once during initial vehicle configuration (it is not a normal pre-flight command and has been poorly named)."]
1557 MAV_CMD_PREFLIGHT_UAVCAN = 243,
1558 #[doc = "Request storage of different parameter values and logs. This command will be only accepted if in pre-flight mode."]
1559 MAV_CMD_PREFLIGHT_STORAGE = 245,
1560 #[doc = "Request the reboot or shutdown of system components."]
1561 MAV_CMD_PREFLIGHT_REBOOT_SHUTDOWN = 246,
1562 #[doc = "Override current mission with command to pause mission, pause mission and move to position, continue/resume mission. When param 1 indicates that the mission is paused (MAV_GOTO_DO_HOLD), param 2 defines whether it holds in place or moves to another position."]
1563 MAV_CMD_OVERRIDE_GOTO = 252,
1564 #[doc = "Mission command to set a Camera Auto Mount Pivoting Oblique Survey (Replaces CAM_TRIGG_DIST for this purpose). The camera is triggered each time this distance is exceeded, then the mount moves to the next position. Params 4~6 set-up the angle limits and number of positions for oblique survey, where mount-enabled vehicles automatically roll the camera between shots to emulate an oblique camera setup (providing an increased HFOV). This command can also be used to set the shutter integration time for the camera."]
1565 MAV_CMD_OBLIQUE_SURVEY = 260,
1566 #[doc = "Enable the specified standard MAVLink mode. If the specified mode is not supported, the vehicle should ACK with MAV_RESULT_FAILED. See <https://mavlink.io/en/services/standard_modes.html>"]
1567 MAV_CMD_DO_SET_STANDARD_MODE = 262,
1568 #[doc = "start running a mission"]
1569 MAV_CMD_MISSION_START = 300,
1570 #[doc = "Actuator testing command. This is similar to MAV_CMD_DO_MOTOR_TEST but operates on the level of output functions, i.e. it is possible to test Motor1 independent from which output it is configured on. Autopilots must NACK this command with MAV_RESULT_TEMPORARILY_REJECTED while armed."]
1571 MAV_CMD_ACTUATOR_TEST = 310,
1572 #[doc = "Actuator configuration command."]
1573 MAV_CMD_CONFIGURE_ACTUATOR = 311,
1574 #[doc = "Arms / Disarms a component"]
1575 MAV_CMD_COMPONENT_ARM_DISARM = 400,
1576 #[doc = "Instructs a target system to run pre-arm checks. This allows preflight checks to be run on demand, which may be useful on systems that normally run them at low rate, or which do not trigger checks when the armable state might have changed. This command should return MAV_RESULT_ACCEPTED if it will run the checks. The results of the checks are usually then reported in SYS_STATUS messages (this is system-specific). The command should return MAV_RESULT_TEMPORARILY_REJECTED if the system is already armed."]
1577 MAV_CMD_RUN_PREARM_CHECKS = 401,
1578 #[doc = "Turns illuminators ON/OFF. An illuminator is a light source that is used for lighting up dark areas external to the system: e.g. a torch or searchlight (as opposed to a light source for illuminating the system itself, e.g. an indicator light)."]
1579 MAV_CMD_ILLUMINATOR_ON_OFF = 405,
1580 #[doc = "Configures illuminator settings. An illuminator is a light source that is used for lighting up dark areas external to the system: e.g. a torch or searchlight (as opposed to a light source for illuminating the system itself, e.g. an indicator light)."]
1581 MAV_CMD_DO_ILLUMINATOR_CONFIGURE = 406,
1582 #[deprecated = " See `MAV_CMD_REQUEST_MESSAGE` (Deprecated since 2022-04)"]
1583 #[doc = "Request the home position from the vehicle. \t The vehicle will ACK the command and then emit the HOME_POSITION message."]
1584 MAV_CMD_GET_HOME_POSITION = 410,
1585 #[doc = "Inject artificial failure for testing purposes. Note that autopilots should implement an additional protection before accepting this command such as a specific param setting."]
1586 MAV_CMD_INJECT_FAILURE = 420,
1587 #[doc = "Starts receiver pairing."]
1588 MAV_CMD_START_RX_PAIR = 500,
1589 #[deprecated = " See `MAV_CMD_REQUEST_MESSAGE` (Deprecated since 2022-04)"]
1590 #[doc = "Request the interval between messages for a particular MAVLink message ID. The receiver should ACK the command and then emit its response in a MESSAGE_INTERVAL message."]
1591 MAV_CMD_GET_MESSAGE_INTERVAL = 510,
1592 #[doc = "Set the interval between messages for a particular MAVLink message ID. This interface replaces REQUEST_DATA_STREAM."]
1593 MAV_CMD_SET_MESSAGE_INTERVAL = 511,
1594 #[doc = "Request the target system(s) emit a single instance of a specified message (i.e. a \"one-shot\" version of MAV_CMD_SET_MESSAGE_INTERVAL)."]
1595 MAV_CMD_REQUEST_MESSAGE = 512,
1596 #[deprecated = " See `MAV_CMD_REQUEST_MESSAGE` (Deprecated since 2019-08)"]
1597 #[doc = "Request MAVLink protocol version compatibility. All receivers should ACK the command and then emit their capabilities in an PROTOCOL_VERSION message"]
1598 MAV_CMD_REQUEST_PROTOCOL_VERSION = 519,
1599 #[deprecated = " See `MAV_CMD_REQUEST_MESSAGE` (Deprecated since 2019-08)"]
1600 #[doc = "Request autopilot capabilities. The receiver should ACK the command and then emit its capabilities in an AUTOPILOT_VERSION message"]
1601 MAV_CMD_REQUEST_AUTOPILOT_CAPABILITIES = 520,
1602 #[deprecated = " See `MAV_CMD_REQUEST_MESSAGE` (Deprecated since 2019-08)"]
1603 #[doc = "Request camera information (CAMERA_INFORMATION)."]
1604 MAV_CMD_REQUEST_CAMERA_INFORMATION = 521,
1605 #[deprecated = " See `MAV_CMD_REQUEST_MESSAGE` (Deprecated since 2019-08)"]
1606 #[doc = "Request camera settings (CAMERA_SETTINGS)."]
1607 MAV_CMD_REQUEST_CAMERA_SETTINGS = 522,
1608 #[deprecated = " See `MAV_CMD_REQUEST_MESSAGE` (Deprecated since 2019-08)"]
1609 #[doc = "Request storage information (STORAGE_INFORMATION). Use the command's target_component to target a specific component's storage."]
1610 MAV_CMD_REQUEST_STORAGE_INFORMATION = 525,
1611 #[doc = "Format a storage medium. Once format is complete, a STORAGE_INFORMATION message is sent. Use the command's target_component to target a specific component's storage."]
1612 MAV_CMD_STORAGE_FORMAT = 526,
1613 #[deprecated = " See `MAV_CMD_REQUEST_MESSAGE` (Deprecated since 2019-08)"]
1614 #[doc = "Request camera capture status (CAMERA_CAPTURE_STATUS)"]
1615 MAV_CMD_REQUEST_CAMERA_CAPTURE_STATUS = 527,
1616 #[deprecated = " See `MAV_CMD_REQUEST_MESSAGE` (Deprecated since 2019-08)"]
1617 #[doc = "Request flight information (FLIGHT_INFORMATION)"]
1618 MAV_CMD_REQUEST_FLIGHT_INFORMATION = 528,
1619 #[doc = "Reset all camera settings to Factory Default"]
1620 MAV_CMD_RESET_CAMERA_SETTINGS = 529,
1621 #[doc = "Set camera running mode. Use NaN for reserved values. GCS will send a MAV_CMD_REQUEST_VIDEO_STREAM_STATUS command after a mode change if the camera supports video streaming."]
1622 MAV_CMD_SET_CAMERA_MODE = 530,
1623 #[doc = "Set camera zoom. Camera must respond with a CAMERA_SETTINGS message (on success)."]
1624 MAV_CMD_SET_CAMERA_ZOOM = 531,
1625 #[doc = "Set camera focus. Camera must respond with a CAMERA_SETTINGS message (on success)."]
1626 MAV_CMD_SET_CAMERA_FOCUS = 532,
1627 #[doc = "Set that a particular storage is the preferred location for saving photos, videos, and/or other media (e.g. to set that an SD card is used for storing videos). There can only be one preferred save location for each particular media type: setting a media usage flag will clear/reset that same flag if set on any other storage. If no flag is set the system should use its default storage. A target system can choose to always use default storage, in which case it should ACK the command with MAV_RESULT_UNSUPPORTED. A target system can choose to not allow a particular storage to be set as preferred storage, in which case it should ACK the command with MAV_RESULT_DENIED."]
1628 MAV_CMD_SET_STORAGE_USAGE = 533,
1629 #[doc = "Set camera source. Changes the camera's active sources on cameras with multiple image sensors."]
1630 MAV_CMD_SET_CAMERA_SOURCE = 534,
1631 #[doc = "Tagged jump target. Can be jumped to with MAV_CMD_DO_JUMP_TAG."]
1632 MAV_CMD_JUMP_TAG = 600,
1633 #[doc = "Jump to the matching tag in the mission list. Repeat this action for the specified number of times. A mission should contain a single matching tag for each jump. If this is not the case then a jump to a missing tag should complete the mission, and a jump where there are multiple matching tags should always select the one with the lowest mission sequence number."]
1634 MAV_CMD_DO_JUMP_TAG = 601,
1635 #[doc = "Set gimbal manager pitch/yaw setpoints (low rate command). It is possible to set combinations of the values below. E.g. an angle as well as a desired angular rate can be used to get to this angle at a certain angular rate, or an angular rate only will result in continuous turning. NaN is to be used to signal unset. Note: only the gimbal manager will react to this command - it will be ignored by a gimbal device. Use GIMBAL_MANAGER_SET_PITCHYAW if you need to stream pitch/yaw setpoints at higher rate."]
1636 MAV_CMD_DO_GIMBAL_MANAGER_PITCHYAW = 1000,
1637 #[doc = "Gimbal configuration to set which sysid/compid is in primary and secondary control."]
1638 MAV_CMD_DO_GIMBAL_MANAGER_CONFIGURE = 1001,
1639 #[doc = "Start image capture sequence. CAMERA_IMAGE_CAPTURED must be emitted after each capture. Param1 (id) may be used to specify the target camera: 0: all cameras, 1 to 6: autopilot-connected cameras, 7-255: MAVLink camera component ID. It is needed in order to target specific cameras connected to the autopilot, or specific sensors in a multi-sensor camera (neither of which have a distinct MAVLink component ID). It is also needed to specify the target camera in missions. When used in a mission, an autopilot should execute the MAV_CMD for a specified local camera (param1 = 1-6), or resend it as a command if it is intended for a MAVLink camera (param1 = 7 - 255), setting the command's target_component as the param1 value (and setting param1 in the command to zero). If the param1 is 0 the autopilot should do both. When sent in a command the target MAVLink address is set using target_component. If addressed specifically to an autopilot: param1 should be used in the same way as it is for missions (though command should NACK with MAV_RESULT_DENIED if a specified local camera does not exist). If addressed to a MAVLink camera, param 1 can be used to address all cameras (0), or to separately address 1 to 7 individual sensors. Other values should be NACKed with MAV_RESULT_DENIED. If the command is broadcast (target_component is 0) then param 1 should be set to 0 (any other value should be NACKED with MAV_RESULT_DENIED). An autopilot would trigger any local cameras and forward the command to all channels."]
1640 MAV_CMD_IMAGE_START_CAPTURE = 2000,
1641 #[doc = "Stop image capture sequence. Param1 (id) may be used to specify the target camera: 0: all cameras, 1 to 6: autopilot-connected cameras, 7-255: MAVLink camera component ID. It is needed in order to target specific cameras connected to the autopilot, or specific sensors in a multi-sensor camera (neither of which have a distinct MAVLink component ID). It is also needed to specify the target camera in missions. When used in a mission, an autopilot should execute the MAV_CMD for a specified local camera (param1 = 1-6), or resend it as a command if it is intended for a MAVLink camera (param1 = 7 - 255), setting the command's target_component as the param1 value (and setting param1 in the command to zero). If the param1 is 0 the autopilot should do both. When sent in a command the target MAVLink address is set using target_component. If addressed specifically to an autopilot: param1 should be used in the same way as it is for missions (though command should NACK with MAV_RESULT_DENIED if a specified local camera does not exist). If addressed to a MAVLink camera, param1 can be used to address all cameras (0), or to separately address 1 to 7 individual sensors. Other values should be NACKed with MAV_RESULT_DENIED. If the command is broadcast (target_component is 0) then param 1 should be set to 0 (any other value should be NACKED with MAV_RESULT_DENIED). An autopilot would trigger any local cameras and forward the command to all channels."]
1642 MAV_CMD_IMAGE_STOP_CAPTURE = 2001,
1643 #[deprecated = " See `MAV_CMD_REQUEST_MESSAGE` (Deprecated since 2019-08)"]
1644 #[doc = "Re-request a CAMERA_IMAGE_CAPTURED message."]
1645 MAV_CMD_REQUEST_CAMERA_IMAGE_CAPTURE = 2002,
1646 #[doc = "Enable or disable on-board camera triggering system."]
1647 MAV_CMD_DO_TRIGGER_CONTROL = 2003,
1648 #[doc = "If the camera supports point visual tracking (CAMERA_CAP_FLAGS_HAS_TRACKING_POINT is set), this command allows to initiate the tracking."]
1649 MAV_CMD_CAMERA_TRACK_POINT = 2004,
1650 #[doc = "If the camera supports rectangle visual tracking (CAMERA_CAP_FLAGS_HAS_TRACKING_RECTANGLE is set), this command allows to initiate the tracking."]
1651 MAV_CMD_CAMERA_TRACK_RECTANGLE = 2005,
1652 #[doc = "Stops ongoing tracking."]
1653 MAV_CMD_CAMERA_STOP_TRACKING = 2010,
1654 #[doc = "Starts video capture (recording)."]
1655 MAV_CMD_VIDEO_START_CAPTURE = 2500,
1656 #[doc = "Stop the current video capture (recording)."]
1657 MAV_CMD_VIDEO_STOP_CAPTURE = 2501,
1658 #[doc = "Start video streaming"]
1659 MAV_CMD_VIDEO_START_STREAMING = 2502,
1660 #[doc = "Stop the given video stream"]
1661 MAV_CMD_VIDEO_STOP_STREAMING = 2503,
1662 #[deprecated = " See `MAV_CMD_REQUEST_MESSAGE` (Deprecated since 2019-08)"]
1663 #[doc = "Request video stream information (VIDEO_STREAM_INFORMATION)"]
1664 MAV_CMD_REQUEST_VIDEO_STREAM_INFORMATION = 2504,
1665 #[deprecated = " See `MAV_CMD_REQUEST_MESSAGE` (Deprecated since 2019-08)"]
1666 #[doc = "Request video stream status (VIDEO_STREAM_STATUS)"]
1667 MAV_CMD_REQUEST_VIDEO_STREAM_STATUS = 2505,
1668 #[doc = "Request to start streaming logging data over MAVLink (see also LOGGING_DATA message)"]
1669 MAV_CMD_LOGGING_START = 2510,
1670 #[doc = "Request to stop streaming log data over MAVLink"]
1671 MAV_CMD_LOGGING_STOP = 2511,
1672 MAV_CMD_AIRFRAME_CONFIGURATION = 2520,
1673 #[doc = "Request to start/stop transmitting over the high latency telemetry"]
1674 MAV_CMD_CONTROL_HIGH_LATENCY = 2600,
1675 #[doc = "Create a panorama at the current position"]
1676 MAV_CMD_PANORAMA_CREATE = 2800,
1677 #[doc = "Request VTOL transition"]
1678 MAV_CMD_DO_VTOL_TRANSITION = 3000,
1679 #[doc = "Request authorization to arm the vehicle to a external entity, the arm authorizer is responsible to request all data that is needs from the vehicle before authorize or deny the request. \t\tIf approved the COMMAND_ACK message progress field should be set with period of time that this authorization is valid in seconds. \t\tIf the authorization is denied COMMAND_ACK.result_param2 should be set with one of the reasons in ARM_AUTH_DENIED_REASON."]
1680 MAV_CMD_ARM_AUTHORIZATION_REQUEST = 3001,
1681 #[doc = "This command sets the submode to standard guided when vehicle is in guided mode. The vehicle holds position and altitude and the user can input the desired velocities along all three axes."]
1682 MAV_CMD_SET_GUIDED_SUBMODE_STANDARD = 4000,
1683 #[doc = "This command sets submode circle when vehicle is in guided mode. Vehicle flies along a circle facing the center of the circle. The user can input the velocity along the circle and change the radius. If no input is given the vehicle will hold position."]
1684 MAV_CMD_SET_GUIDED_SUBMODE_CIRCLE = 4001,
1685 #[doc = "Delay mission state machine until gate has been reached."]
1686 MAV_CMD_CONDITION_GATE = 4501,
1687 #[doc = "Fence return point (there can only be one such point in a geofence definition). If rally points are supported they should be used instead."]
1688 MAV_CMD_NAV_FENCE_RETURN_POINT = 5000,
1689 #[doc = "Fence vertex for an inclusion polygon (the polygon must not be self-intersecting). The vehicle must stay within this area. Minimum of 3 vertices required. The vertices for a polygon must be sent sequentially, each with param1 set to the total number of vertices in the polygon."]
1690 MAV_CMD_NAV_FENCE_POLYGON_VERTEX_INCLUSION = 5001,
1691 #[doc = "Fence vertex for an exclusion polygon (the polygon must not be self-intersecting). The vehicle must stay outside this area. Minimum of 3 vertices required. The vertices for a polygon must be sent sequentially, each with param1 set to the total number of vertices in the polygon."]
1692 MAV_CMD_NAV_FENCE_POLYGON_VERTEX_EXCLUSION = 5002,
1693 #[doc = "Circular fence area. The vehicle must stay inside this area."]
1694 MAV_CMD_NAV_FENCE_CIRCLE_INCLUSION = 5003,
1695 #[doc = "Circular fence area. The vehicle must stay outside this area."]
1696 MAV_CMD_NAV_FENCE_CIRCLE_EXCLUSION = 5004,
1697 #[doc = "Rally point. You can have multiple rally points defined."]
1698 MAV_CMD_NAV_RALLY_POINT = 5100,
1699 #[doc = "Commands the vehicle to respond with a sequence of messages UAVCAN_NODE_INFO, one message per every UAVCAN node that is online. Note that some of the response messages can be lost, which the receiver can detect easily by checking whether every received UAVCAN_NODE_STATUS has a matching message UAVCAN_NODE_INFO received earlier; if not, this command should be sent again in order to request re-transmission of the node information messages."]
1700 MAV_CMD_UAVCAN_GET_NODE_INFO = 5200,
1701 #[doc = "Change state of safety switch."]
1702 MAV_CMD_DO_SET_SAFETY_SWITCH_STATE = 5300,
1703 #[doc = "Trigger the start of an ADSB-out IDENT. This should only be used when requested to do so by an Air Traffic Controller in controlled airspace. This starts the IDENT which is then typically held for 18 seconds by the hardware per the Mode A, C, and S transponder spec."]
1704 MAV_CMD_DO_ADSB_OUT_IDENT = 10001,
1705 #[deprecated = " (Deprecated since 2021-06)"]
1706 #[doc = "Deploy payload on a Lat / Lon / Alt position. This includes the navigation to reach the required release position and velocity."]
1707 MAV_CMD_PAYLOAD_PREPARE_DEPLOY = 30001,
1708 #[deprecated = " (Deprecated since 2021-06)"]
1709 #[doc = "Control the payload deployment."]
1710 MAV_CMD_PAYLOAD_CONTROL_DEPLOY = 30002,
1711 #[doc = "Magnetometer calibration based on provided known yaw. This allows for fast calibration using WMM field tables in the vehicle, given only the known yaw of the vehicle. If Latitude and longitude are both zero then use the current vehicle location."]
1712 MAV_CMD_FIXED_MAG_CAL_YAW = 42006,
1713 #[doc = "Command to operate winch."]
1714 MAV_CMD_DO_WINCH = 42600,
1715 #[doc = "Provide an external position estimate for use when dead-reckoning. This is meant to be used for occasional position resets that may be provided by a external system such as a remote pilot using landmarks over a video link."]
1716 MAV_CMD_EXTERNAL_POSITION_ESTIMATE = 43003,
1717 #[doc = "User defined waypoint item. Ground Station will show the Vehicle as flying through this item."]
1718 MAV_CMD_WAYPOINT_USER_1 = 31000,
1719 #[doc = "User defined waypoint item. Ground Station will show the Vehicle as flying through this item."]
1720 MAV_CMD_WAYPOINT_USER_2 = 31001,
1721 #[doc = "User defined waypoint item. Ground Station will show the Vehicle as flying through this item."]
1722 MAV_CMD_WAYPOINT_USER_3 = 31002,
1723 #[doc = "User defined waypoint item. Ground Station will show the Vehicle as flying through this item."]
1724 MAV_CMD_WAYPOINT_USER_4 = 31003,
1725 #[doc = "User defined waypoint item. Ground Station will show the Vehicle as flying through this item."]
1726 MAV_CMD_WAYPOINT_USER_5 = 31004,
1727 #[doc = "User defined spatial item. Ground Station will not show the Vehicle as flying through this item. Example: ROI item."]
1728 MAV_CMD_SPATIAL_USER_1 = 31005,
1729 #[doc = "User defined spatial item. Ground Station will not show the Vehicle as flying through this item. Example: ROI item."]
1730 MAV_CMD_SPATIAL_USER_2 = 31006,
1731 #[doc = "User defined spatial item. Ground Station will not show the Vehicle as flying through this item. Example: ROI item."]
1732 MAV_CMD_SPATIAL_USER_3 = 31007,
1733 #[doc = "User defined spatial item. Ground Station will not show the Vehicle as flying through this item. Example: ROI item."]
1734 MAV_CMD_SPATIAL_USER_4 = 31008,
1735 #[doc = "User defined spatial item. Ground Station will not show the Vehicle as flying through this item. Example: ROI item."]
1736 MAV_CMD_SPATIAL_USER_5 = 31009,
1737 #[doc = "User defined command. Ground Station will not show the Vehicle as flying through this item. Example: MAV_CMD_DO_SET_PARAMETER item."]
1738 MAV_CMD_USER_1 = 31010,
1739 #[doc = "User defined command. Ground Station will not show the Vehicle as flying through this item. Example: MAV_CMD_DO_SET_PARAMETER item."]
1740 MAV_CMD_USER_2 = 31011,
1741 #[doc = "User defined command. Ground Station will not show the Vehicle as flying through this item. Example: MAV_CMD_DO_SET_PARAMETER item."]
1742 MAV_CMD_USER_3 = 31012,
1743 #[doc = "User defined command. Ground Station will not show the Vehicle as flying through this item. Example: MAV_CMD_DO_SET_PARAMETER item."]
1744 MAV_CMD_USER_4 = 31013,
1745 #[doc = "User defined command. Ground Station will not show the Vehicle as flying through this item. Example: MAV_CMD_DO_SET_PARAMETER item."]
1746 MAV_CMD_USER_5 = 31014,
1747 #[doc = "Request forwarding of CAN packets from the given CAN bus to this component. CAN Frames are sent using CAN_FRAME and CANFD_FRAME messages"]
1748 MAV_CMD_CAN_FORWARD = 32000,
1749}
1750impl MavCmd {
1751 pub const DEFAULT: Self = Self::MAV_CMD_NAV_WAYPOINT;
1752}
1753impl Default for MavCmd {
1754 fn default() -> Self {
1755 Self::DEFAULT
1756 }
1757}
1758#[cfg_attr(feature = "ts", derive(TS))]
1759#[cfg_attr(feature = "ts", ts(export))]
1760#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1761#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1762#[cfg_attr(feature = "serde", serde(tag = "type"))]
1763#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1764#[repr(u32)]
1765#[doc = "Possible actions an aircraft can take to avoid a collision."]
1766pub enum MavCollisionAction {
1767 #[doc = "Ignore any potential collisions"]
1768 MAV_COLLISION_ACTION_NONE = 0,
1769 #[doc = "Report potential collision"]
1770 MAV_COLLISION_ACTION_REPORT = 1,
1771 #[doc = "Ascend or Descend to avoid threat"]
1772 MAV_COLLISION_ACTION_ASCEND_OR_DESCEND = 2,
1773 #[doc = "Move horizontally to avoid threat"]
1774 MAV_COLLISION_ACTION_MOVE_HORIZONTALLY = 3,
1775 #[doc = "Aircraft to move perpendicular to the collision's velocity vector"]
1776 MAV_COLLISION_ACTION_MOVE_PERPENDICULAR = 4,
1777 #[doc = "Aircraft to fly directly back to its launch point"]
1778 MAV_COLLISION_ACTION_RTL = 5,
1779 #[doc = "Aircraft to stop in place"]
1780 MAV_COLLISION_ACTION_HOVER = 6,
1781}
1782impl MavCollisionAction {
1783 pub const DEFAULT: Self = Self::MAV_COLLISION_ACTION_NONE;
1784}
1785impl Default for MavCollisionAction {
1786 fn default() -> Self {
1787 Self::DEFAULT
1788 }
1789}
1790#[cfg_attr(feature = "ts", derive(TS))]
1791#[cfg_attr(feature = "ts", ts(export))]
1792#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1793#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1794#[cfg_attr(feature = "serde", serde(tag = "type"))]
1795#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1796#[repr(u32)]
1797#[doc = "Source of information about this collision."]
1798pub enum MavCollisionSrc {
1799 #[doc = "ID field references ADSB_VEHICLE packets"]
1800 MAV_COLLISION_SRC_ADSB = 0,
1801 #[doc = "ID field references MAVLink SRC ID"]
1802 MAV_COLLISION_SRC_MAVLINK_GPS_GLOBAL_INT = 1,
1803}
1804impl MavCollisionSrc {
1805 pub const DEFAULT: Self = Self::MAV_COLLISION_SRC_ADSB;
1806}
1807impl Default for MavCollisionSrc {
1808 fn default() -> Self {
1809 Self::DEFAULT
1810 }
1811}
1812#[cfg_attr(feature = "ts", derive(TS))]
1813#[cfg_attr(feature = "ts", ts(export))]
1814#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1815#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1816#[cfg_attr(feature = "serde", serde(tag = "type"))]
1817#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1818#[repr(u32)]
1819#[doc = "Aircraft-rated danger from this threat."]
1820pub enum MavCollisionThreatLevel {
1821 #[doc = "Not a threat"]
1822 MAV_COLLISION_THREAT_LEVEL_NONE = 0,
1823 #[doc = "Craft is mildly concerned about this threat"]
1824 MAV_COLLISION_THREAT_LEVEL_LOW = 1,
1825 #[doc = "Craft is panicking, and may take actions to avoid threat"]
1826 MAV_COLLISION_THREAT_LEVEL_HIGH = 2,
1827}
1828impl MavCollisionThreatLevel {
1829 pub const DEFAULT: Self = Self::MAV_COLLISION_THREAT_LEVEL_NONE;
1830}
1831impl Default for MavCollisionThreatLevel {
1832 fn default() -> Self {
1833 Self::DEFAULT
1834 }
1835}
1836#[cfg_attr(feature = "ts", derive(TS))]
1837#[cfg_attr(feature = "ts", ts(export))]
1838#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1839#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1840#[cfg_attr(feature = "serde", serde(tag = "type"))]
1841#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1842#[repr(u32)]
1843#[doc = "Component ids (values) for the different types and instances of onboard hardware/software that might make up a MAVLink system (autopilot, cameras, servos, GPS systems, avoidance systems etc.). Components must use the appropriate ID in their source address when sending messages. Components can also use IDs to determine if they are the intended recipient of an incoming message. The MAV_COMP_ID_ALL value is used to indicate messages that must be processed by all components. When creating new entries, components that can have multiple instances (e.g. cameras, servos etc.) should be allocated sequential values. An appropriate number of values should be left free after these components to allow the number of instances to be expanded."]
1844pub enum MavComponent {
1845 #[doc = "Target id (target_component) used to broadcast messages to all components of the receiving system. Components should attempt to process messages with this component ID and forward to components on any other interfaces. Note: This is not a valid *source* component id for a message."]
1846 MAV_COMP_ID_ALL = 0,
1847 #[doc = "System flight controller component (\"autopilot\"). Only one autopilot is expected in a particular system."]
1848 MAV_COMP_ID_AUTOPILOT1 = 1,
1849 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1850 MAV_COMP_ID_USER1 = 25,
1851 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1852 MAV_COMP_ID_USER2 = 26,
1853 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1854 MAV_COMP_ID_USER3 = 27,
1855 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1856 MAV_COMP_ID_USER4 = 28,
1857 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1858 MAV_COMP_ID_USER5 = 29,
1859 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1860 MAV_COMP_ID_USER6 = 30,
1861 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1862 MAV_COMP_ID_USER7 = 31,
1863 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1864 MAV_COMP_ID_USER8 = 32,
1865 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1866 MAV_COMP_ID_USER9 = 33,
1867 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1868 MAV_COMP_ID_USER10 = 34,
1869 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1870 MAV_COMP_ID_USER11 = 35,
1871 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1872 MAV_COMP_ID_USER12 = 36,
1873 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1874 MAV_COMP_ID_USER13 = 37,
1875 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1876 MAV_COMP_ID_USER14 = 38,
1877 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1878 MAV_COMP_ID_USER15 = 39,
1879 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1880 MAV_COMP_ID_USER16 = 40,
1881 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1882 MAV_COMP_ID_USER17 = 41,
1883 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1884 MAV_COMP_ID_USER18 = 42,
1885 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1886 MAV_COMP_ID_USER19 = 43,
1887 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1888 MAV_COMP_ID_USER20 = 44,
1889 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1890 MAV_COMP_ID_USER21 = 45,
1891 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1892 MAV_COMP_ID_USER22 = 46,
1893 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1894 MAV_COMP_ID_USER23 = 47,
1895 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1896 MAV_COMP_ID_USER24 = 48,
1897 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1898 MAV_COMP_ID_USER25 = 49,
1899 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1900 MAV_COMP_ID_USER26 = 50,
1901 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1902 MAV_COMP_ID_USER27 = 51,
1903 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1904 MAV_COMP_ID_USER28 = 52,
1905 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1906 MAV_COMP_ID_USER29 = 53,
1907 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1908 MAV_COMP_ID_USER30 = 54,
1909 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1910 MAV_COMP_ID_USER31 = 55,
1911 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1912 MAV_COMP_ID_USER32 = 56,
1913 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1914 MAV_COMP_ID_USER33 = 57,
1915 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1916 MAV_COMP_ID_USER34 = 58,
1917 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1918 MAV_COMP_ID_USER35 = 59,
1919 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1920 MAV_COMP_ID_USER36 = 60,
1921 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1922 MAV_COMP_ID_USER37 = 61,
1923 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1924 MAV_COMP_ID_USER38 = 62,
1925 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1926 MAV_COMP_ID_USER39 = 63,
1927 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1928 MAV_COMP_ID_USER40 = 64,
1929 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1930 MAV_COMP_ID_USER41 = 65,
1931 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1932 MAV_COMP_ID_USER42 = 66,
1933 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1934 MAV_COMP_ID_USER43 = 67,
1935 #[doc = "Telemetry radio (e.g. SiK radio, or other component that emits RADIO_STATUS messages)."]
1936 MAV_COMP_ID_TELEMETRY_RADIO = 68,
1937 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1938 MAV_COMP_ID_USER45 = 69,
1939 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1940 MAV_COMP_ID_USER46 = 70,
1941 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1942 MAV_COMP_ID_USER47 = 71,
1943 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1944 MAV_COMP_ID_USER48 = 72,
1945 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1946 MAV_COMP_ID_USER49 = 73,
1947 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1948 MAV_COMP_ID_USER50 = 74,
1949 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1950 MAV_COMP_ID_USER51 = 75,
1951 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1952 MAV_COMP_ID_USER52 = 76,
1953 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1954 MAV_COMP_ID_USER53 = 77,
1955 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1956 MAV_COMP_ID_USER54 = 78,
1957 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1958 MAV_COMP_ID_USER55 = 79,
1959 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1960 MAV_COMP_ID_USER56 = 80,
1961 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1962 MAV_COMP_ID_USER57 = 81,
1963 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1964 MAV_COMP_ID_USER58 = 82,
1965 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1966 MAV_COMP_ID_USER59 = 83,
1967 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1968 MAV_COMP_ID_USER60 = 84,
1969 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1970 MAV_COMP_ID_USER61 = 85,
1971 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1972 MAV_COMP_ID_USER62 = 86,
1973 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1974 MAV_COMP_ID_USER63 = 87,
1975 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1976 MAV_COMP_ID_USER64 = 88,
1977 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1978 MAV_COMP_ID_USER65 = 89,
1979 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1980 MAV_COMP_ID_USER66 = 90,
1981 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1982 MAV_COMP_ID_USER67 = 91,
1983 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1984 MAV_COMP_ID_USER68 = 92,
1985 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1986 MAV_COMP_ID_USER69 = 93,
1987 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1988 MAV_COMP_ID_USER70 = 94,
1989 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1990 MAV_COMP_ID_USER71 = 95,
1991 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1992 MAV_COMP_ID_USER72 = 96,
1993 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1994 MAV_COMP_ID_USER73 = 97,
1995 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1996 MAV_COMP_ID_USER74 = 98,
1997 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1998 MAV_COMP_ID_USER75 = 99,
1999 #[doc = "Camera #1."]
2000 MAV_COMP_ID_CAMERA = 100,
2001 #[doc = "Camera #2."]
2002 MAV_COMP_ID_CAMERA2 = 101,
2003 #[doc = "Camera #3."]
2004 MAV_COMP_ID_CAMERA3 = 102,
2005 #[doc = "Camera #4."]
2006 MAV_COMP_ID_CAMERA4 = 103,
2007 #[doc = "Camera #5."]
2008 MAV_COMP_ID_CAMERA5 = 104,
2009 #[doc = "Camera #6."]
2010 MAV_COMP_ID_CAMERA6 = 105,
2011 #[doc = "Servo #1."]
2012 MAV_COMP_ID_SERVO1 = 140,
2013 #[doc = "Servo #2."]
2014 MAV_COMP_ID_SERVO2 = 141,
2015 #[doc = "Servo #3."]
2016 MAV_COMP_ID_SERVO3 = 142,
2017 #[doc = "Servo #4."]
2018 MAV_COMP_ID_SERVO4 = 143,
2019 #[doc = "Servo #5."]
2020 MAV_COMP_ID_SERVO5 = 144,
2021 #[doc = "Servo #6."]
2022 MAV_COMP_ID_SERVO6 = 145,
2023 #[doc = "Servo #7."]
2024 MAV_COMP_ID_SERVO7 = 146,
2025 #[doc = "Servo #8."]
2026 MAV_COMP_ID_SERVO8 = 147,
2027 #[doc = "Servo #9."]
2028 MAV_COMP_ID_SERVO9 = 148,
2029 #[doc = "Servo #10."]
2030 MAV_COMP_ID_SERVO10 = 149,
2031 #[doc = "Servo #11."]
2032 MAV_COMP_ID_SERVO11 = 150,
2033 #[doc = "Servo #12."]
2034 MAV_COMP_ID_SERVO12 = 151,
2035 #[doc = "Servo #13."]
2036 MAV_COMP_ID_SERVO13 = 152,
2037 #[doc = "Servo #14."]
2038 MAV_COMP_ID_SERVO14 = 153,
2039 #[doc = "Gimbal #1."]
2040 MAV_COMP_ID_GIMBAL = 154,
2041 #[doc = "Logging component."]
2042 MAV_COMP_ID_LOG = 155,
2043 #[doc = "Automatic Dependent Surveillance-Broadcast (ADS-B) component."]
2044 MAV_COMP_ID_ADSB = 156,
2045 #[doc = "On Screen Display (OSD) devices for video links."]
2046 MAV_COMP_ID_OSD = 157,
2047 #[doc = "Generic autopilot peripheral component ID. Meant for devices that do not implement the parameter microservice."]
2048 MAV_COMP_ID_PERIPHERAL = 158,
2049 #[deprecated = "All gimbals should use MAV_COMP_ID_GIMBAL. See `MAV_COMP_ID_GIMBAL` (Deprecated since 2018-11)"]
2050 #[doc = "Gimbal ID for QX1."]
2051 MAV_COMP_ID_QX1_GIMBAL = 159,
2052 #[doc = "FLARM collision alert component."]
2053 MAV_COMP_ID_FLARM = 160,
2054 #[doc = "Parachute component."]
2055 MAV_COMP_ID_PARACHUTE = 161,
2056 #[doc = "Winch component."]
2057 MAV_COMP_ID_WINCH = 169,
2058 #[doc = "Gimbal #2."]
2059 MAV_COMP_ID_GIMBAL2 = 171,
2060 #[doc = "Gimbal #3."]
2061 MAV_COMP_ID_GIMBAL3 = 172,
2062 #[doc = "Gimbal #4"]
2063 MAV_COMP_ID_GIMBAL4 = 173,
2064 #[doc = "Gimbal #5."]
2065 MAV_COMP_ID_GIMBAL5 = 174,
2066 #[doc = "Gimbal #6."]
2067 MAV_COMP_ID_GIMBAL6 = 175,
2068 #[doc = "Battery #1."]
2069 MAV_COMP_ID_BATTERY = 180,
2070 #[doc = "Battery #2."]
2071 MAV_COMP_ID_BATTERY2 = 181,
2072 #[doc = "CAN over MAVLink client."]
2073 MAV_COMP_ID_MAVCAN = 189,
2074 #[doc = "Component that can generate/supply a mission flight plan (e.g. GCS or developer API)."]
2075 MAV_COMP_ID_MISSIONPLANNER = 190,
2076 #[doc = "Component that lives on the onboard computer (companion computer) and has some generic functionalities, such as settings system parameters and monitoring the status of some processes that don't directly speak mavlink and so on."]
2077 MAV_COMP_ID_ONBOARD_COMPUTER = 191,
2078 #[doc = "Component that lives on the onboard computer (companion computer) and has some generic functionalities, such as settings system parameters and monitoring the status of some processes that don't directly speak mavlink and so on."]
2079 MAV_COMP_ID_ONBOARD_COMPUTER2 = 192,
2080 #[doc = "Component that lives on the onboard computer (companion computer) and has some generic functionalities, such as settings system parameters and monitoring the status of some processes that don't directly speak mavlink and so on."]
2081 MAV_COMP_ID_ONBOARD_COMPUTER3 = 193,
2082 #[doc = "Component that lives on the onboard computer (companion computer) and has some generic functionalities, such as settings system parameters and monitoring the status of some processes that don't directly speak mavlink and so on."]
2083 MAV_COMP_ID_ONBOARD_COMPUTER4 = 194,
2084 #[doc = "Component that finds an optimal path between points based on a certain constraint (e.g. minimum snap, shortest path, cost, etc.)."]
2085 MAV_COMP_ID_PATHPLANNER = 195,
2086 #[doc = "Component that plans a collision free path between two points."]
2087 MAV_COMP_ID_OBSTACLE_AVOIDANCE = 196,
2088 #[doc = "Component that provides position estimates using VIO techniques."]
2089 MAV_COMP_ID_VISUAL_INERTIAL_ODOMETRY = 197,
2090 #[doc = "Component that manages pairing of vehicle and GCS."]
2091 MAV_COMP_ID_PAIRING_MANAGER = 198,
2092 #[doc = "Inertial Measurement Unit (IMU) #1."]
2093 MAV_COMP_ID_IMU = 200,
2094 #[doc = "Inertial Measurement Unit (IMU) #2."]
2095 MAV_COMP_ID_IMU_2 = 201,
2096 #[doc = "Inertial Measurement Unit (IMU) #3."]
2097 MAV_COMP_ID_IMU_3 = 202,
2098 #[doc = "GPS #1."]
2099 MAV_COMP_ID_GPS = 220,
2100 #[doc = "GPS #2."]
2101 MAV_COMP_ID_GPS2 = 221,
2102 #[doc = "Open Drone ID transmitter/receiver (Bluetooth/WiFi/Internet)."]
2103 MAV_COMP_ID_ODID_TXRX_1 = 236,
2104 #[doc = "Open Drone ID transmitter/receiver (Bluetooth/WiFi/Internet)."]
2105 MAV_COMP_ID_ODID_TXRX_2 = 237,
2106 #[doc = "Open Drone ID transmitter/receiver (Bluetooth/WiFi/Internet)."]
2107 MAV_COMP_ID_ODID_TXRX_3 = 238,
2108 #[doc = "Component to bridge MAVLink to UDP (i.e. from a UART)."]
2109 MAV_COMP_ID_UDP_BRIDGE = 240,
2110 #[doc = "Component to bridge to UART (i.e. from UDP)."]
2111 MAV_COMP_ID_UART_BRIDGE = 241,
2112 #[doc = "Component handling TUNNEL messages (e.g. vendor specific GUI of a component)."]
2113 MAV_COMP_ID_TUNNEL_NODE = 242,
2114 #[doc = "Illuminator"]
2115 MAV_COMP_ID_ILLUMINATOR = 243,
2116 #[deprecated = "System control does not require a separate component ID. Instead, system commands should be sent with target_component=MAV_COMP_ID_ALL allowing the target component to use any appropriate component id. See `MAV_COMP_ID_ALL` (Deprecated since 2018-11)"]
2117 #[doc = "Deprecated, don't use. Component for handling system messages (e.g. to ARM, takeoff, etc.)."]
2118 MAV_COMP_ID_SYSTEM_CONTROL = 250,
2119}
2120impl MavComponent {
2121 pub const DEFAULT: Self = Self::MAV_COMP_ID_ALL;
2122}
2123impl Default for MavComponent {
2124 fn default() -> Self {
2125 Self::DEFAULT
2126 }
2127}
2128#[cfg_attr(feature = "ts", derive(TS))]
2129#[cfg_attr(feature = "ts", ts(export))]
2130#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2131#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2132#[cfg_attr(feature = "serde", serde(tag = "type"))]
2133#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2134#[repr(u32)]
2135#[deprecated = " See `MESSAGE_INTERVAL` (Deprecated since 2015-06)"]
2136#[doc = "A data stream is not a fixed set of messages, but rather a recommendation to the autopilot software. Individual autopilots may or may not obey the recommended messages."]
2137pub enum MavDataStream {
2138 #[doc = "Enable all data streams"]
2139 MAV_DATA_STREAM_ALL = 0,
2140 #[doc = "Enable IMU_RAW, GPS_RAW, GPS_STATUS packets."]
2141 MAV_DATA_STREAM_RAW_SENSORS = 1,
2142 #[doc = "Enable GPS_STATUS, CONTROL_STATUS, AUX_STATUS"]
2143 MAV_DATA_STREAM_EXTENDED_STATUS = 2,
2144 #[doc = "Enable RC_CHANNELS_SCALED, RC_CHANNELS_RAW, SERVO_OUTPUT_RAW"]
2145 MAV_DATA_STREAM_RC_CHANNELS = 3,
2146 #[doc = "Enable ATTITUDE_CONTROLLER_OUTPUT, POSITION_CONTROLLER_OUTPUT, NAV_CONTROLLER_OUTPUT."]
2147 MAV_DATA_STREAM_RAW_CONTROLLER = 4,
2148 #[doc = "Enable LOCAL_POSITION, GLOBAL_POSITION_INT messages."]
2149 MAV_DATA_STREAM_POSITION = 6,
2150 #[doc = "Dependent on the autopilot"]
2151 MAV_DATA_STREAM_EXTRA1 = 10,
2152 #[doc = "Dependent on the autopilot"]
2153 MAV_DATA_STREAM_EXTRA2 = 11,
2154 #[doc = "Dependent on the autopilot"]
2155 MAV_DATA_STREAM_EXTRA3 = 12,
2156}
2157impl MavDataStream {
2158 pub const DEFAULT: Self = Self::MAV_DATA_STREAM_ALL;
2159}
2160impl Default for MavDataStream {
2161 fn default() -> Self {
2162 Self::DEFAULT
2163 }
2164}
2165#[cfg_attr(feature = "ts", derive(TS))]
2166#[cfg_attr(feature = "ts", ts(export))]
2167#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2168#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2169#[cfg_attr(feature = "serde", serde(tag = "type"))]
2170#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2171#[repr(u32)]
2172#[doc = "Enumeration of distance sensor types"]
2173pub enum MavDistanceSensor {
2174 #[doc = "Laser rangefinder, e.g. LightWare SF02/F or PulsedLight units"]
2175 MAV_DISTANCE_SENSOR_LASER = 0,
2176 #[doc = "Ultrasound rangefinder, e.g. MaxBotix units"]
2177 MAV_DISTANCE_SENSOR_ULTRASOUND = 1,
2178 #[doc = "Infrared rangefinder, e.g. Sharp units"]
2179 MAV_DISTANCE_SENSOR_INFRARED = 2,
2180 #[doc = "Radar type, e.g. uLanding units"]
2181 MAV_DISTANCE_SENSOR_RADAR = 3,
2182 #[doc = "Broken or unknown type, e.g. analog units"]
2183 MAV_DISTANCE_SENSOR_UNKNOWN = 4,
2184}
2185impl MavDistanceSensor {
2186 pub const DEFAULT: Self = Self::MAV_DISTANCE_SENSOR_LASER;
2187}
2188impl Default for MavDistanceSensor {
2189 fn default() -> Self {
2190 Self::DEFAULT
2191 }
2192}
2193#[cfg_attr(feature = "ts", derive(TS))]
2194#[cfg_attr(feature = "ts", ts(export))]
2195#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2196#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2197#[cfg_attr(feature = "serde", serde(tag = "type"))]
2198#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2199#[repr(u32)]
2200#[doc = "Bitmap of options for the MAV_CMD_DO_REPOSITION"]
2201pub enum MavDoRepositionFlags {
2202 #[doc = "The aircraft should immediately transition into guided. This should not be set for follow me applications"]
2203 MAV_DO_REPOSITION_FLAGS_CHANGE_MODE = 1,
2204}
2205impl MavDoRepositionFlags {
2206 pub const DEFAULT: Self = Self::MAV_DO_REPOSITION_FLAGS_CHANGE_MODE;
2207}
2208impl Default for MavDoRepositionFlags {
2209 fn default() -> Self {
2210 Self::DEFAULT
2211 }
2212}
2213#[cfg_attr(feature = "ts", derive(TS))]
2214#[cfg_attr(feature = "ts", ts(export))]
2215#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2216#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2217#[cfg_attr(feature = "serde", serde(tag = "type"))]
2218#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2219#[repr(u32)]
2220#[doc = "Enumeration of estimator types"]
2221pub enum MavEstimatorType {
2222 #[doc = "Unknown type of the estimator."]
2223 MAV_ESTIMATOR_TYPE_UNKNOWN = 0,
2224 #[doc = "This is a naive estimator without any real covariance feedback."]
2225 MAV_ESTIMATOR_TYPE_NAIVE = 1,
2226 #[doc = "Computer vision based estimate. Might be up to scale."]
2227 MAV_ESTIMATOR_TYPE_VISION = 2,
2228 #[doc = "Visual-inertial estimate."]
2229 MAV_ESTIMATOR_TYPE_VIO = 3,
2230 #[doc = "Plain GPS estimate."]
2231 MAV_ESTIMATOR_TYPE_GPS = 4,
2232 #[doc = "Estimator integrating GPS and inertial sensing."]
2233 MAV_ESTIMATOR_TYPE_GPS_INS = 5,
2234 #[doc = "Estimate from external motion capturing system."]
2235 MAV_ESTIMATOR_TYPE_MOCAP = 6,
2236 #[doc = "Estimator based on lidar sensor input."]
2237 MAV_ESTIMATOR_TYPE_LIDAR = 7,
2238 #[doc = "Estimator on autopilot."]
2239 MAV_ESTIMATOR_TYPE_AUTOPILOT = 8,
2240}
2241impl MavEstimatorType {
2242 pub const DEFAULT: Self = Self::MAV_ESTIMATOR_TYPE_UNKNOWN;
2243}
2244impl Default for MavEstimatorType {
2245 fn default() -> Self {
2246 Self::DEFAULT
2247 }
2248}
2249#[cfg_attr(feature = "ts", derive(TS))]
2250#[cfg_attr(feature = "ts", ts(export))]
2251#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2252#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2253#[cfg_attr(feature = "serde", serde(tag = "type"))]
2254#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2255#[repr(u32)]
2256#[doc = "Flags for CURRENT_EVENT_SEQUENCE."]
2257pub enum MavEventCurrentSequenceFlags {
2258 #[doc = "A sequence reset has happened (e.g. vehicle reboot)."]
2259 MAV_EVENT_CURRENT_SEQUENCE_FLAGS_RESET = 1,
2260}
2261impl MavEventCurrentSequenceFlags {
2262 pub const DEFAULT: Self = Self::MAV_EVENT_CURRENT_SEQUENCE_FLAGS_RESET;
2263}
2264impl Default for MavEventCurrentSequenceFlags {
2265 fn default() -> Self {
2266 Self::DEFAULT
2267 }
2268}
2269#[cfg_attr(feature = "ts", derive(TS))]
2270#[cfg_attr(feature = "ts", ts(export))]
2271#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2272#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2273#[cfg_attr(feature = "serde", serde(tag = "type"))]
2274#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2275#[repr(u32)]
2276#[doc = "Reason for an event error response."]
2277pub enum MavEventErrorReason {
2278 #[doc = "The requested event is not available (anymore)."]
2279 MAV_EVENT_ERROR_REASON_UNAVAILABLE = 0,
2280}
2281impl MavEventErrorReason {
2282 pub const DEFAULT: Self = Self::MAV_EVENT_ERROR_REASON_UNAVAILABLE;
2283}
2284impl Default for MavEventErrorReason {
2285 fn default() -> Self {
2286 Self::DEFAULT
2287 }
2288}
2289#[cfg_attr(feature = "ts", derive(TS))]
2290#[cfg_attr(feature = "ts", ts(export))]
2291#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2292#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2293#[cfg_attr(feature = "serde", serde(tag = "type"))]
2294#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2295#[repr(u32)]
2296#[doc = "Coordinate frames used by MAVLink. Not all frames are supported by all commands, messages, or vehicles. Global frames use the following naming conventions: - \"GLOBAL\": Global coordinate frame with WGS84 latitude/longitude and altitude positive over mean sea level (MSL) by default. The following modifiers may be used with \"GLOBAL\": - \"RELATIVE_ALT\": Altitude is relative to the vehicle home position rather than MSL. - \"TERRAIN_ALT\": Altitude is relative to ground level rather than MSL. - \"INT\": Latitude/longitude (in degrees) are scaled by multiplying by 1E7. Local frames use the following naming conventions: - \"LOCAL\": Origin of local frame is fixed relative to earth. Unless otherwise specified this origin is the origin of the vehicle position-estimator (\"EKF\"). - \"BODY\": Origin of local frame travels with the vehicle. NOTE, \"BODY\" does NOT indicate alignment of frame axis with vehicle attitude. - \"OFFSET\": Deprecated synonym for \"BODY\" (origin travels with the vehicle). Not to be used for new frames. Some deprecated frames do not follow these conventions (e.g. MAV_FRAME_BODY_NED and MAV_FRAME_BODY_OFFSET_NED)."]
2297pub enum MavFrame {
2298 #[doc = "Global (WGS84) coordinate frame + altitude relative to mean sea level (MSL)."]
2299 MAV_FRAME_GLOBAL = 0,
2300 #[doc = "NED local tangent frame (x: North, y: East, z: Down) with origin fixed relative to earth."]
2301 MAV_FRAME_LOCAL_NED = 1,
2302 #[doc = "NOT a coordinate frame, indicates a mission command."]
2303 MAV_FRAME_MISSION = 2,
2304 #[doc = "Global (WGS84) coordinate frame + altitude relative to the home position."]
2305 MAV_FRAME_GLOBAL_RELATIVE_ALT = 3,
2306 #[doc = "ENU local tangent frame (x: East, y: North, z: Up) with origin fixed relative to earth."]
2307 MAV_FRAME_LOCAL_ENU = 4,
2308 #[deprecated = "Use MAV_FRAME_GLOBAL in COMMAND_INT (and elsewhere) as a synonymous replacement. See `MAV_FRAME_GLOBAL` (Deprecated since 2024-03)"]
2309 #[doc = "Global (WGS84) coordinate frame (scaled) + altitude relative to mean sea level (MSL)."]
2310 MAV_FRAME_GLOBAL_INT = 5,
2311 #[deprecated = "Use MAV_FRAME_GLOBAL_RELATIVE_ALT in COMMAND_INT (and elsewhere) as a synonymous replacement. See `MAV_FRAME_GLOBAL_RELATIVE_ALT` (Deprecated since 2024-03)"]
2312 #[doc = "Global (WGS84) coordinate frame (scaled) + altitude relative to the home position."]
2313 MAV_FRAME_GLOBAL_RELATIVE_ALT_INT = 6,
2314 #[doc = "NED local tangent frame (x: North, y: East, z: Down) with origin that travels with the vehicle."]
2315 MAV_FRAME_LOCAL_OFFSET_NED = 7,
2316 #[deprecated = " See `MAV_FRAME_BODY_FRD` (Deprecated since 2019-08)"]
2317 #[doc = "Same as MAV_FRAME_LOCAL_NED when used to represent position values. Same as MAV_FRAME_BODY_FRD when used with velocity/acceleration values."]
2318 MAV_FRAME_BODY_NED = 8,
2319 #[deprecated = " See `MAV_FRAME_BODY_FRD` (Deprecated since 2019-08)"]
2320 #[doc = "This is the same as MAV_FRAME_BODY_FRD."]
2321 MAV_FRAME_BODY_OFFSET_NED = 9,
2322 #[doc = "Global (WGS84) coordinate frame with AGL altitude (altitude at ground level)."]
2323 MAV_FRAME_GLOBAL_TERRAIN_ALT = 10,
2324 #[deprecated = "Use MAV_FRAME_GLOBAL_TERRAIN_ALT in COMMAND_INT (and elsewhere) as a synonymous replacement. See `MAV_FRAME_GLOBAL_TERRAIN_ALT` (Deprecated since 2024-03)"]
2325 #[doc = "Global (WGS84) coordinate frame (scaled) with AGL altitude (altitude at ground level)."]
2326 MAV_FRAME_GLOBAL_TERRAIN_ALT_INT = 11,
2327 #[doc = "FRD local frame aligned to the vehicle's attitude (x: Forward, y: Right, z: Down) with an origin that travels with vehicle."]
2328 MAV_FRAME_BODY_FRD = 12,
2329 #[deprecated = " (Deprecated since 2019-04)"]
2330 #[doc = "MAV_FRAME_BODY_FLU - Body fixed frame of reference, Z-up (x: Forward, y: Left, z: Up)."]
2331 MAV_FRAME_RESERVED_13 = 13,
2332 #[deprecated = " See `MAV_FRAME_LOCAL_FRD` (Deprecated since 2019-04)"]
2333 #[doc = "MAV_FRAME_MOCAP_NED - Odometry local coordinate frame of data given by a motion capture system, Z-down (x: North, y: East, z: Down)."]
2334 MAV_FRAME_RESERVED_14 = 14,
2335 #[deprecated = " See `MAV_FRAME_LOCAL_FLU` (Deprecated since 2019-04)"]
2336 #[doc = "MAV_FRAME_MOCAP_ENU - Odometry local coordinate frame of data given by a motion capture system, Z-up (x: East, y: North, z: Up)."]
2337 MAV_FRAME_RESERVED_15 = 15,
2338 #[deprecated = " See `MAV_FRAME_LOCAL_FRD` (Deprecated since 2019-04)"]
2339 #[doc = "MAV_FRAME_VISION_NED - Odometry local coordinate frame of data given by a vision estimation system, Z-down (x: North, y: East, z: Down)."]
2340 MAV_FRAME_RESERVED_16 = 16,
2341 #[deprecated = " See `MAV_FRAME_LOCAL_FLU` (Deprecated since 2019-04)"]
2342 #[doc = "MAV_FRAME_VISION_ENU - Odometry local coordinate frame of data given by a vision estimation system, Z-up (x: East, y: North, z: Up)."]
2343 MAV_FRAME_RESERVED_17 = 17,
2344 #[deprecated = " See `MAV_FRAME_LOCAL_FRD` (Deprecated since 2019-04)"]
2345 #[doc = "MAV_FRAME_ESTIM_NED - Odometry local coordinate frame of data given by an estimator running onboard the vehicle, Z-down (x: North, y: East, z: Down)."]
2346 MAV_FRAME_RESERVED_18 = 18,
2347 #[deprecated = " See `MAV_FRAME_LOCAL_FLU` (Deprecated since 2019-04)"]
2348 #[doc = "MAV_FRAME_ESTIM_ENU - Odometry local coordinate frame of data given by an estimator running onboard the vehicle, Z-up (x: East, y: North, z: Up)."]
2349 MAV_FRAME_RESERVED_19 = 19,
2350 #[doc = "FRD local tangent frame (x: Forward, y: Right, z: Down) with origin fixed relative to earth. The forward axis is aligned to the front of the vehicle in the horizontal plane."]
2351 MAV_FRAME_LOCAL_FRD = 20,
2352 #[doc = "FLU local tangent frame (x: Forward, y: Left, z: Up) with origin fixed relative to earth. The forward axis is aligned to the front of the vehicle in the horizontal plane."]
2353 MAV_FRAME_LOCAL_FLU = 21,
2354}
2355impl MavFrame {
2356 pub const DEFAULT: Self = Self::MAV_FRAME_GLOBAL;
2357}
2358impl Default for MavFrame {
2359 fn default() -> Self {
2360 Self::DEFAULT
2361 }
2362}
2363#[cfg_attr(feature = "ts", derive(TS))]
2364#[cfg_attr(feature = "ts", ts(export))]
2365#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2366#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2367#[cfg_attr(feature = "serde", serde(tag = "type"))]
2368#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2369#[repr(u32)]
2370#[doc = "MAV FTP error codes (<https://mavlink.io/en/services/ftp.html>)"]
2371pub enum MavFtpErr {
2372 #[doc = "None: No error"]
2373 MAV_FTP_ERR_NONE = 0,
2374 #[doc = "Fail: Unknown failure"]
2375 MAV_FTP_ERR_FAIL = 1,
2376 #[doc = "FailErrno: Command failed, Err number sent back in PayloadHeader.data[1]. \t\tThis is a file-system error number understood by the server operating system."]
2377 MAV_FTP_ERR_FAILERRNO = 2,
2378 #[doc = "InvalidDataSize: Payload size is invalid"]
2379 MAV_FTP_ERR_INVALIDDATASIZE = 3,
2380 #[doc = "InvalidSession: Session is not currently open"]
2381 MAV_FTP_ERR_INVALIDSESSION = 4,
2382 #[doc = "NoSessionsAvailable: All available sessions are already in use"]
2383 MAV_FTP_ERR_NOSESSIONSAVAILABLE = 5,
2384 #[doc = "EOF: Offset past end of file for ListDirectory and ReadFile commands"]
2385 MAV_FTP_ERR_EOF = 6,
2386 #[doc = "UnknownCommand: Unknown command / opcode"]
2387 MAV_FTP_ERR_UNKNOWNCOMMAND = 7,
2388 #[doc = "FileExists: File/directory already exists"]
2389 MAV_FTP_ERR_FILEEXISTS = 8,
2390 #[doc = "FileProtected: File/directory is write protected"]
2391 MAV_FTP_ERR_FILEPROTECTED = 9,
2392 #[doc = "FileNotFound: File/directory not found"]
2393 MAV_FTP_ERR_FILENOTFOUND = 10,
2394}
2395impl MavFtpErr {
2396 pub const DEFAULT: Self = Self::MAV_FTP_ERR_NONE;
2397}
2398impl Default for MavFtpErr {
2399 fn default() -> Self {
2400 Self::DEFAULT
2401 }
2402}
2403#[cfg_attr(feature = "ts", derive(TS))]
2404#[cfg_attr(feature = "ts", ts(export))]
2405#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2406#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2407#[cfg_attr(feature = "serde", serde(tag = "type"))]
2408#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2409#[repr(u32)]
2410#[doc = "MAV FTP opcodes: <https://mavlink.io/en/services/ftp.html>"]
2411pub enum MavFtpOpcode {
2412 #[doc = "None. Ignored, always ACKed"]
2413 MAV_FTP_OPCODE_NONE = 0,
2414 #[doc = "TerminateSession: Terminates open Read session"]
2415 MAV_FTP_OPCODE_TERMINATESESSION = 1,
2416 #[doc = "ResetSessions: Terminates all open read sessions"]
2417 MAV_FTP_OPCODE_RESETSESSION = 2,
2418 #[doc = "ListDirectory. List files and directories in path from offset"]
2419 MAV_FTP_OPCODE_LISTDIRECTORY = 3,
2420 #[doc = "OpenFileRO: Opens file at path for reading, returns session"]
2421 MAV_FTP_OPCODE_OPENFILERO = 4,
2422 #[doc = "ReadFile: Reads size bytes from offset in session"]
2423 MAV_FTP_OPCODE_READFILE = 5,
2424 #[doc = "CreateFile: Creates file at path for writing, returns session"]
2425 MAV_FTP_OPCODE_CREATEFILE = 6,
2426 #[doc = "WriteFile: Writes size bytes to offset in session"]
2427 MAV_FTP_OPCODE_WRITEFILE = 7,
2428 #[doc = "RemoveFile: Remove file at path"]
2429 MAV_FTP_OPCODE_REMOVEFILE = 8,
2430 #[doc = "CreateDirectory: Creates directory at path"]
2431 MAV_FTP_OPCODE_CREATEDIRECTORY = 9,
2432 #[doc = "RemoveDirectory: Removes directory at path. The directory must be empty."]
2433 MAV_FTP_OPCODE_REMOVEDIRECTORY = 10,
2434 #[doc = "OpenFileWO: Opens file at path for writing, returns session"]
2435 MAV_FTP_OPCODE_OPENFILEWO = 11,
2436 #[doc = "TruncateFile: Truncate file at path to offset length"]
2437 MAV_FTP_OPCODE_TRUNCATEFILE = 12,
2438 #[doc = "Rename: Rename path1 to path2"]
2439 MAV_FTP_OPCODE_RENAME = 13,
2440 #[doc = "CalcFileCRC32: Calculate CRC32 for file at path"]
2441 MAV_FTP_OPCODE_CALCFILECRC = 14,
2442 #[doc = "BurstReadFile: Burst download session file"]
2443 MAV_FTP_OPCODE_BURSTREADFILE = 15,
2444 #[doc = "ACK: ACK response"]
2445 MAV_FTP_OPCODE_ACK = 128,
2446 #[doc = "NAK: NAK response"]
2447 MAV_FTP_OPCODE_NAK = 129,
2448}
2449impl MavFtpOpcode {
2450 pub const DEFAULT: Self = Self::MAV_FTP_OPCODE_NONE;
2451}
2452impl Default for MavFtpOpcode {
2453 fn default() -> Self {
2454 Self::DEFAULT
2455 }
2456}
2457#[cfg_attr(feature = "ts", derive(TS))]
2458#[cfg_attr(feature = "ts", ts(export))]
2459#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2460#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2461#[cfg_attr(feature = "serde", serde(tag = "type"))]
2462#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2463#[repr(u32)]
2464#[doc = "Fuel types for use in FUEL_TYPE. Fuel types specify the units for the maximum, available and consumed fuel, and for the flow rates."]
2465pub enum MavFuelType {
2466 #[doc = "Not specified. Fuel levels are normalized (i.e. maximum is 1, and other levels are relative to 1)."]
2467 MAV_FUEL_TYPE_UNKNOWN = 0,
2468 #[doc = "A generic liquid fuel. Fuel levels are in millilitres (ml). Fuel rates are in millilitres/second."]
2469 MAV_FUEL_TYPE_LIQUID = 1,
2470 #[doc = "A gas tank. Fuel levels are in kilo-Pascal (kPa), and flow rates are in milliliters per second (ml/s)."]
2471 MAV_FUEL_TYPE_GAS = 2,
2472}
2473impl MavFuelType {
2474 pub const DEFAULT: Self = Self::MAV_FUEL_TYPE_UNKNOWN;
2475}
2476impl Default for MavFuelType {
2477 fn default() -> Self {
2478 Self::DEFAULT
2479 }
2480}
2481bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Flags to report status/failure cases for a power generator (used in GENERATOR_STATUS). Note that FAULTS are conditions that cause the generator to fail. Warnings are conditions that require attention before the next use (they indicate the system is not operating properly)."] pub struct MavGeneratorStatusFlag : u64 { # [doc = "Generator is off."] const MAV_GENERATOR_STATUS_FLAG_OFF = 1 ; # [doc = "Generator is ready to start generating power."] const MAV_GENERATOR_STATUS_FLAG_READY = 2 ; # [doc = "Generator is generating power."] const MAV_GENERATOR_STATUS_FLAG_GENERATING = 4 ; # [doc = "Generator is charging the batteries (generating enough power to charge and provide the load)."] const MAV_GENERATOR_STATUS_FLAG_CHARGING = 8 ; # [doc = "Generator is operating at a reduced maximum power."] const MAV_GENERATOR_STATUS_FLAG_REDUCED_POWER = 16 ; # [doc = "Generator is providing the maximum output."] const MAV_GENERATOR_STATUS_FLAG_MAXPOWER = 32 ; # [doc = "Generator is near the maximum operating temperature, cooling is insufficient."] const MAV_GENERATOR_STATUS_FLAG_OVERTEMP_WARNING = 64 ; # [doc = "Generator hit the maximum operating temperature and shutdown."] const MAV_GENERATOR_STATUS_FLAG_OVERTEMP_FAULT = 128 ; # [doc = "Power electronics are near the maximum operating temperature, cooling is insufficient."] const MAV_GENERATOR_STATUS_FLAG_ELECTRONICS_OVERTEMP_WARNING = 256 ; # [doc = "Power electronics hit the maximum operating temperature and shutdown."] const MAV_GENERATOR_STATUS_FLAG_ELECTRONICS_OVERTEMP_FAULT = 512 ; # [doc = "Power electronics experienced a fault and shutdown."] const MAV_GENERATOR_STATUS_FLAG_ELECTRONICS_FAULT = 1024 ; # [doc = "The power source supplying the generator failed e.g. mechanical generator stopped, tether is no longer providing power, solar cell is in shade, hydrogen reaction no longer happening."] const MAV_GENERATOR_STATUS_FLAG_POWERSOURCE_FAULT = 2048 ; # [doc = "Generator controller having communication problems."] const MAV_GENERATOR_STATUS_FLAG_COMMUNICATION_WARNING = 4096 ; # [doc = "Power electronic or generator cooling system error."] const MAV_GENERATOR_STATUS_FLAG_COOLING_WARNING = 8192 ; # [doc = "Generator controller power rail experienced a fault."] const MAV_GENERATOR_STATUS_FLAG_POWER_RAIL_FAULT = 16384 ; # [doc = "Generator controller exceeded the overcurrent threshold and shutdown to prevent damage."] const MAV_GENERATOR_STATUS_FLAG_OVERCURRENT_FAULT = 32768 ; # [doc = "Generator controller detected a high current going into the batteries and shutdown to prevent battery damage."] const MAV_GENERATOR_STATUS_FLAG_BATTERY_OVERCHARGE_CURRENT_FAULT = 65536 ; # [doc = "Generator controller exceeded it's overvoltage threshold and shutdown to prevent it exceeding the voltage rating."] const MAV_GENERATOR_STATUS_FLAG_OVERVOLTAGE_FAULT = 131072 ; # [doc = "Batteries are under voltage (generator will not start)."] const MAV_GENERATOR_STATUS_FLAG_BATTERY_UNDERVOLT_FAULT = 262144 ; # [doc = "Generator start is inhibited by e.g. a safety switch."] const MAV_GENERATOR_STATUS_FLAG_START_INHIBITED = 524288 ; # [doc = "Generator requires maintenance."] const MAV_GENERATOR_STATUS_FLAG_MAINTENANCE_REQUIRED = 1048576 ; # [doc = "Generator is not ready to generate yet."] const MAV_GENERATOR_STATUS_FLAG_WARMING_UP = 2097152 ; # [doc = "Generator is idle."] const MAV_GENERATOR_STATUS_FLAG_IDLE = 4194304 ; } }
2482impl MavGeneratorStatusFlag {
2483 pub const DEFAULT: Self = Self::MAV_GENERATOR_STATUS_FLAG_OFF;
2484}
2485impl Default for MavGeneratorStatusFlag {
2486 fn default() -> Self {
2487 Self::DEFAULT
2488 }
2489}
2490#[cfg_attr(feature = "ts", derive(TS))]
2491#[cfg_attr(feature = "ts", ts(export))]
2492#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2493#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2494#[cfg_attr(feature = "serde", serde(tag = "type"))]
2495#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2496#[repr(u32)]
2497#[doc = "Actions that may be specified in MAV_CMD_OVERRIDE_GOTO to override mission execution."]
2498pub enum MavGoto {
2499 #[doc = "Hold at the current position."]
2500 MAV_GOTO_DO_HOLD = 0,
2501 #[doc = "Continue with the next item in mission execution."]
2502 MAV_GOTO_DO_CONTINUE = 1,
2503 #[doc = "Hold at the current position of the system"]
2504 MAV_GOTO_HOLD_AT_CURRENT_POSITION = 2,
2505 #[doc = "Hold at the position specified in the parameters of the DO_HOLD action"]
2506 MAV_GOTO_HOLD_AT_SPECIFIED_POSITION = 3,
2507}
2508impl MavGoto {
2509 pub const DEFAULT: Self = Self::MAV_GOTO_DO_HOLD;
2510}
2511impl Default for MavGoto {
2512 fn default() -> Self {
2513 Self::DEFAULT
2514 }
2515}
2516#[cfg_attr(feature = "ts", derive(TS))]
2517#[cfg_attr(feature = "ts", ts(export))]
2518#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2519#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2520#[cfg_attr(feature = "serde", serde(tag = "type"))]
2521#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2522#[repr(u32)]
2523#[doc = "Enumeration of landed detector states"]
2524pub enum MavLandedState {
2525 #[doc = "MAV landed state is unknown"]
2526 MAV_LANDED_STATE_UNDEFINED = 0,
2527 #[doc = "MAV is landed (on ground)"]
2528 MAV_LANDED_STATE_ON_GROUND = 1,
2529 #[doc = "MAV is in air"]
2530 MAV_LANDED_STATE_IN_AIR = 2,
2531 #[doc = "MAV currently taking off"]
2532 MAV_LANDED_STATE_TAKEOFF = 3,
2533 #[doc = "MAV currently landing"]
2534 MAV_LANDED_STATE_LANDING = 4,
2535}
2536impl MavLandedState {
2537 pub const DEFAULT: Self = Self::MAV_LANDED_STATE_UNDEFINED;
2538}
2539impl Default for MavLandedState {
2540 fn default() -> Self {
2541 Self::DEFAULT
2542 }
2543}
2544#[cfg_attr(feature = "ts", derive(TS))]
2545#[cfg_attr(feature = "ts", ts(export))]
2546#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2547#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2548#[cfg_attr(feature = "serde", serde(tag = "type"))]
2549#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2550#[repr(u32)]
2551#[doc = "Result of mission operation (in a MISSION_ACK message)."]
2552pub enum MavMissionResult {
2553 #[doc = "mission accepted OK"]
2554 MAV_MISSION_ACCEPTED = 0,
2555 #[doc = "Generic error / not accepting mission commands at all right now."]
2556 MAV_MISSION_ERROR = 1,
2557 #[doc = "Coordinate frame is not supported."]
2558 MAV_MISSION_UNSUPPORTED_FRAME = 2,
2559 #[doc = "Command is not supported."]
2560 MAV_MISSION_UNSUPPORTED = 3,
2561 #[doc = "Mission items exceed storage space."]
2562 MAV_MISSION_NO_SPACE = 4,
2563 #[doc = "One of the parameters has an invalid value."]
2564 MAV_MISSION_INVALID = 5,
2565 #[doc = "param1 has an invalid value."]
2566 MAV_MISSION_INVALID_PARAM1 = 6,
2567 #[doc = "param2 has an invalid value."]
2568 MAV_MISSION_INVALID_PARAM2 = 7,
2569 #[doc = "param3 has an invalid value."]
2570 MAV_MISSION_INVALID_PARAM3 = 8,
2571 #[doc = "param4 has an invalid value."]
2572 MAV_MISSION_INVALID_PARAM4 = 9,
2573 #[doc = "x / param5 has an invalid value."]
2574 MAV_MISSION_INVALID_PARAM5_X = 10,
2575 #[doc = "y / param6 has an invalid value."]
2576 MAV_MISSION_INVALID_PARAM6_Y = 11,
2577 #[doc = "z / param7 has an invalid value."]
2578 MAV_MISSION_INVALID_PARAM7 = 12,
2579 #[doc = "Mission item received out of sequence"]
2580 MAV_MISSION_INVALID_SEQUENCE = 13,
2581 #[doc = "Not accepting any mission commands from this communication partner."]
2582 MAV_MISSION_DENIED = 14,
2583 #[doc = "Current mission operation cancelled (e.g. mission upload, mission download)."]
2584 MAV_MISSION_OPERATION_CANCELLED = 15,
2585}
2586impl MavMissionResult {
2587 pub const DEFAULT: Self = Self::MAV_MISSION_ACCEPTED;
2588}
2589impl Default for MavMissionResult {
2590 fn default() -> Self {
2591 Self::DEFAULT
2592 }
2593}
2594#[cfg_attr(feature = "ts", derive(TS))]
2595#[cfg_attr(feature = "ts", ts(export))]
2596#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2597#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2598#[cfg_attr(feature = "serde", serde(tag = "type"))]
2599#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2600#[repr(u32)]
2601#[doc = "Type of mission items being requested/sent in mission protocol."]
2602pub enum MavMissionType {
2603 #[doc = "Items are mission commands for main mission."]
2604 MAV_MISSION_TYPE_MISSION = 0,
2605 #[doc = "Specifies GeoFence area(s). Items are MAV_CMD_NAV_FENCE_ GeoFence items."]
2606 MAV_MISSION_TYPE_FENCE = 1,
2607 #[doc = "Specifies the rally points for the vehicle. Rally points are alternative RTL points. Items are MAV_CMD_NAV_RALLY_POINT rally point items."]
2608 MAV_MISSION_TYPE_RALLY = 2,
2609 #[doc = "Only used in MISSION_CLEAR_ALL to clear all mission types."]
2610 MAV_MISSION_TYPE_ALL = 255,
2611}
2612impl MavMissionType {
2613 pub const DEFAULT: Self = Self::MAV_MISSION_TYPE_MISSION;
2614}
2615impl Default for MavMissionType {
2616 fn default() -> Self {
2617 Self::DEFAULT
2618 }
2619}
2620#[cfg_attr(feature = "ts", derive(TS))]
2621#[cfg_attr(feature = "ts", ts(export))]
2622#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2623#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2624#[cfg_attr(feature = "serde", serde(tag = "type"))]
2625#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2626#[repr(u32)]
2627#[doc = "These defines are predefined OR-combined mode flags. There is no need to use values from this enum, but it simplifies the use of the mode flags. Note that manual input is enabled in all modes as a safety override."]
2628pub enum MavMode {
2629 #[doc = "System is not ready to fly, booting, calibrating, etc. No flag is set."]
2630 MAV_MODE_PREFLIGHT = 0,
2631 #[doc = "System is allowed to be active, under assisted RC control."]
2632 MAV_MODE_STABILIZE_DISARMED = 80,
2633 #[doc = "System is allowed to be active, under assisted RC control."]
2634 MAV_MODE_STABILIZE_ARMED = 208,
2635 #[doc = "System is allowed to be active, under manual (RC) control, no stabilization"]
2636 MAV_MODE_MANUAL_DISARMED = 64,
2637 #[doc = "System is allowed to be active, under manual (RC) control, no stabilization"]
2638 MAV_MODE_MANUAL_ARMED = 192,
2639 #[doc = "System is allowed to be active, under autonomous control, manual setpoint"]
2640 MAV_MODE_GUIDED_DISARMED = 88,
2641 #[doc = "System is allowed to be active, under autonomous control, manual setpoint"]
2642 MAV_MODE_GUIDED_ARMED = 216,
2643 #[doc = "System is allowed to be active, under autonomous control and navigation (the trajectory is decided onboard and not pre-programmed by waypoints)"]
2644 MAV_MODE_AUTO_DISARMED = 92,
2645 #[doc = "System is allowed to be active, under autonomous control and navigation (the trajectory is decided onboard and not pre-programmed by waypoints)"]
2646 MAV_MODE_AUTO_ARMED = 220,
2647 #[doc = "UNDEFINED mode. This solely depends on the autopilot - use with caution, intended for developers only."]
2648 MAV_MODE_TEST_DISARMED = 66,
2649 #[doc = "UNDEFINED mode. This solely depends on the autopilot - use with caution, intended for developers only."]
2650 MAV_MODE_TEST_ARMED = 194,
2651}
2652impl MavMode {
2653 pub const DEFAULT: Self = Self::MAV_MODE_PREFLIGHT;
2654}
2655impl Default for MavMode {
2656 fn default() -> Self {
2657 Self::DEFAULT
2658 }
2659}
2660bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "These flags encode the MAV mode."] pub struct MavModeFlag : u8 { # [doc = "0b10000000 MAV safety set to armed. Motors are enabled / running / can start. Ready to fly. Additional note: this flag is to be ignore when sent in the command MAV_CMD_DO_SET_MODE and MAV_CMD_COMPONENT_ARM_DISARM shall be used instead. The flag can still be used to report the armed state."] const MAV_MODE_FLAG_SAFETY_ARMED = 128 ; # [doc = "0b01000000 remote control input is enabled."] const MAV_MODE_FLAG_MANUAL_INPUT_ENABLED = 64 ; # [doc = "0b00100000 hardware in the loop simulation. All motors / actuators are blocked, but internal software is full operational."] const MAV_MODE_FLAG_HIL_ENABLED = 32 ; # [doc = "0b00010000 system stabilizes electronically its attitude (and optionally position). It needs however further control inputs to move around."] const MAV_MODE_FLAG_STABILIZE_ENABLED = 16 ; # [doc = "0b00001000 guided mode enabled, system flies waypoints / mission items."] const MAV_MODE_FLAG_GUIDED_ENABLED = 8 ; # [doc = "0b00000100 autonomous mode enabled, system finds its own goal positions. Guided flag can be set or not, depends on the actual implementation."] const MAV_MODE_FLAG_AUTO_ENABLED = 4 ; # [doc = "0b00000010 system has a test mode enabled. This flag is intended for temporary system tests and should not be used for stable implementations."] const MAV_MODE_FLAG_TEST_ENABLED = 2 ; # [doc = "0b00000001 Reserved for future use."] const MAV_MODE_FLAG_CUSTOM_MODE_ENABLED = 1 ; } }
2661impl MavModeFlag {
2662 pub const DEFAULT: Self = Self::MAV_MODE_FLAG_SAFETY_ARMED;
2663}
2664impl Default for MavModeFlag {
2665 fn default() -> Self {
2666 Self::DEFAULT
2667 }
2668}
2669#[cfg_attr(feature = "ts", derive(TS))]
2670#[cfg_attr(feature = "ts", ts(export))]
2671#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2672#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2673#[cfg_attr(feature = "serde", serde(tag = "type"))]
2674#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2675#[repr(u32)]
2676#[doc = "These values encode the bit positions of the decode position. These values can be used to read the value of a flag bit by combining the base_mode variable with AND with the flag position value. The result will be either 0 or 1, depending on if the flag is set or not."]
2677pub enum MavModeFlagDecodePosition {
2678 #[doc = "First bit: 10000000"]
2679 MAV_MODE_FLAG_DECODE_POSITION_SAFETY = 128,
2680 #[doc = "Second bit: 01000000"]
2681 MAV_MODE_FLAG_DECODE_POSITION_MANUAL = 64,
2682 #[doc = "Third bit: 00100000"]
2683 MAV_MODE_FLAG_DECODE_POSITION_HIL = 32,
2684 #[doc = "Fourth bit: 00010000"]
2685 MAV_MODE_FLAG_DECODE_POSITION_STABILIZE = 16,
2686 #[doc = "Fifth bit: 00001000"]
2687 MAV_MODE_FLAG_DECODE_POSITION_GUIDED = 8,
2688 #[doc = "Sixth bit: 00000100"]
2689 MAV_MODE_FLAG_DECODE_POSITION_AUTO = 4,
2690 #[doc = "Seventh bit: 00000010"]
2691 MAV_MODE_FLAG_DECODE_POSITION_TEST = 2,
2692 #[doc = "Eighth bit: 00000001"]
2693 MAV_MODE_FLAG_DECODE_POSITION_CUSTOM_MODE = 1,
2694}
2695impl MavModeFlagDecodePosition {
2696 pub const DEFAULT: Self = Self::MAV_MODE_FLAG_DECODE_POSITION_SAFETY;
2697}
2698impl Default for MavModeFlagDecodePosition {
2699 fn default() -> Self {
2700 Self::DEFAULT
2701 }
2702}
2703bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Mode properties."] pub struct MavModeProperty : u32 { # [doc = "If set, this mode is an advanced mode. For example a rate-controlled manual mode might be advanced, whereas a position-controlled manual mode is not. A GCS can optionally use this flag to configure the UI for its intended users."] const MAV_MODE_PROPERTY_ADVANCED = 1 ; # [doc = "If set, this mode should not be added to the list of selectable modes. The mode might still be selected by the FC directly (for example as part of a failsafe)."] const MAV_MODE_PROPERTY_NOT_USER_SELECTABLE = 2 ; # [doc = "If set, this mode is automatically controlled (it may use but does not require a manual controller). If unset the mode is a assumed to require user input (be a manual mode)."] const MAV_MODE_PROPERTY_AUTO_MODE = 4 ; } }
2704impl MavModeProperty {
2705 pub const DEFAULT: Self = Self::MAV_MODE_PROPERTY_ADVANCED;
2706}
2707impl Default for MavModeProperty {
2708 fn default() -> Self {
2709 Self::DEFAULT
2710 }
2711}
2712#[cfg_attr(feature = "ts", derive(TS))]
2713#[cfg_attr(feature = "ts", ts(export))]
2714#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2715#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2716#[cfg_attr(feature = "serde", serde(tag = "type"))]
2717#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2718#[repr(u32)]
2719#[deprecated = " See `GIMBAL_MANAGER_FLAGS` (Deprecated since 2020-01)"]
2720#[doc = "Enumeration of possible mount operation modes. This message is used by obsolete/deprecated gimbal messages."]
2721pub enum MavMountMode {
2722 #[doc = "Load and keep safe position (Roll,Pitch,Yaw) from permanent memory and stop stabilization"]
2723 MAV_MOUNT_MODE_RETRACT = 0,
2724 #[doc = "Load and keep neutral position (Roll,Pitch,Yaw) from permanent memory."]
2725 MAV_MOUNT_MODE_NEUTRAL = 1,
2726 #[doc = "Load neutral position and start MAVLink Roll,Pitch,Yaw control with stabilization"]
2727 MAV_MOUNT_MODE_MAVLINK_TARGETING = 2,
2728 #[doc = "Load neutral position and start RC Roll,Pitch,Yaw control with stabilization"]
2729 MAV_MOUNT_MODE_RC_TARGETING = 3,
2730 #[doc = "Load neutral position and start to point to Lat,Lon,Alt"]
2731 MAV_MOUNT_MODE_GPS_POINT = 4,
2732 #[doc = "Gimbal tracks system with specified system ID"]
2733 MAV_MOUNT_MODE_SYSID_TARGET = 5,
2734 #[doc = "Gimbal tracks home position"]
2735 MAV_MOUNT_MODE_HOME_LOCATION = 6,
2736}
2737impl MavMountMode {
2738 pub const DEFAULT: Self = Self::MAV_MOUNT_MODE_RETRACT;
2739}
2740impl Default for MavMountMode {
2741 fn default() -> Self {
2742 Self::DEFAULT
2743 }
2744}
2745#[cfg_attr(feature = "ts", derive(TS))]
2746#[cfg_attr(feature = "ts", ts(export))]
2747#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2748#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2749#[cfg_attr(feature = "serde", serde(tag = "type"))]
2750#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2751#[repr(u32)]
2752pub enum MavOdidArmStatus {
2753 #[doc = "Passing arming checks."]
2754 MAV_ODID_ARM_STATUS_GOOD_TO_ARM = 0,
2755 #[doc = "Generic arming failure, see error string for details."]
2756 MAV_ODID_ARM_STATUS_PRE_ARM_FAIL_GENERIC = 1,
2757}
2758impl MavOdidArmStatus {
2759 pub const DEFAULT: Self = Self::MAV_ODID_ARM_STATUS_GOOD_TO_ARM;
2760}
2761impl Default for MavOdidArmStatus {
2762 fn default() -> Self {
2763 Self::DEFAULT
2764 }
2765}
2766#[cfg_attr(feature = "ts", derive(TS))]
2767#[cfg_attr(feature = "ts", ts(export))]
2768#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2769#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2770#[cfg_attr(feature = "serde", serde(tag = "type"))]
2771#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2772#[repr(u32)]
2773pub enum MavOdidAuthType {
2774 #[doc = "No authentication type is specified."]
2775 MAV_ODID_AUTH_TYPE_NONE = 0,
2776 #[doc = "Signature for the UAS (Unmanned Aircraft System) ID."]
2777 MAV_ODID_AUTH_TYPE_UAS_ID_SIGNATURE = 1,
2778 #[doc = "Signature for the Operator ID."]
2779 MAV_ODID_AUTH_TYPE_OPERATOR_ID_SIGNATURE = 2,
2780 #[doc = "Signature for the entire message set."]
2781 MAV_ODID_AUTH_TYPE_MESSAGE_SET_SIGNATURE = 3,
2782 #[doc = "Authentication is provided by Network Remote ID."]
2783 MAV_ODID_AUTH_TYPE_NETWORK_REMOTE_ID = 4,
2784 #[doc = "The exact authentication type is indicated by the first byte of authentication_data and these type values are managed by ICAO."]
2785 MAV_ODID_AUTH_TYPE_SPECIFIC_AUTHENTICATION = 5,
2786}
2787impl MavOdidAuthType {
2788 pub const DEFAULT: Self = Self::MAV_ODID_AUTH_TYPE_NONE;
2789}
2790impl Default for MavOdidAuthType {
2791 fn default() -> Self {
2792 Self::DEFAULT
2793 }
2794}
2795#[cfg_attr(feature = "ts", derive(TS))]
2796#[cfg_attr(feature = "ts", ts(export))]
2797#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2798#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2799#[cfg_attr(feature = "serde", serde(tag = "type"))]
2800#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2801#[repr(u32)]
2802pub enum MavOdidCategoryEu {
2803 #[doc = "The category for the UA, according to the EU specification, is undeclared."]
2804 MAV_ODID_CATEGORY_EU_UNDECLARED = 0,
2805 #[doc = "The category for the UA, according to the EU specification, is the Open category."]
2806 MAV_ODID_CATEGORY_EU_OPEN = 1,
2807 #[doc = "The category for the UA, according to the EU specification, is the Specific category."]
2808 MAV_ODID_CATEGORY_EU_SPECIFIC = 2,
2809 #[doc = "The category for the UA, according to the EU specification, is the Certified category."]
2810 MAV_ODID_CATEGORY_EU_CERTIFIED = 3,
2811}
2812impl MavOdidCategoryEu {
2813 pub const DEFAULT: Self = Self::MAV_ODID_CATEGORY_EU_UNDECLARED;
2814}
2815impl Default for MavOdidCategoryEu {
2816 fn default() -> Self {
2817 Self::DEFAULT
2818 }
2819}
2820#[cfg_attr(feature = "ts", derive(TS))]
2821#[cfg_attr(feature = "ts", ts(export))]
2822#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2823#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2824#[cfg_attr(feature = "serde", serde(tag = "type"))]
2825#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2826#[repr(u32)]
2827pub enum MavOdidClassEu {
2828 #[doc = "The class for the UA, according to the EU specification, is undeclared."]
2829 MAV_ODID_CLASS_EU_UNDECLARED = 0,
2830 #[doc = "The class for the UA, according to the EU specification, is Class 0."]
2831 MAV_ODID_CLASS_EU_CLASS_0 = 1,
2832 #[doc = "The class for the UA, according to the EU specification, is Class 1."]
2833 MAV_ODID_CLASS_EU_CLASS_1 = 2,
2834 #[doc = "The class for the UA, according to the EU specification, is Class 2."]
2835 MAV_ODID_CLASS_EU_CLASS_2 = 3,
2836 #[doc = "The class for the UA, according to the EU specification, is Class 3."]
2837 MAV_ODID_CLASS_EU_CLASS_3 = 4,
2838 #[doc = "The class for the UA, according to the EU specification, is Class 4."]
2839 MAV_ODID_CLASS_EU_CLASS_4 = 5,
2840 #[doc = "The class for the UA, according to the EU specification, is Class 5."]
2841 MAV_ODID_CLASS_EU_CLASS_5 = 6,
2842 #[doc = "The class for the UA, according to the EU specification, is Class 6."]
2843 MAV_ODID_CLASS_EU_CLASS_6 = 7,
2844}
2845impl MavOdidClassEu {
2846 pub const DEFAULT: Self = Self::MAV_ODID_CLASS_EU_UNDECLARED;
2847}
2848impl Default for MavOdidClassEu {
2849 fn default() -> Self {
2850 Self::DEFAULT
2851 }
2852}
2853#[cfg_attr(feature = "ts", derive(TS))]
2854#[cfg_attr(feature = "ts", ts(export))]
2855#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2856#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2857#[cfg_attr(feature = "serde", serde(tag = "type"))]
2858#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2859#[repr(u32)]
2860pub enum MavOdidClassificationType {
2861 #[doc = "The classification type for the UA is undeclared."]
2862 MAV_ODID_CLASSIFICATION_TYPE_UNDECLARED = 0,
2863 #[doc = "The classification type for the UA follows EU (European Union) specifications."]
2864 MAV_ODID_CLASSIFICATION_TYPE_EU = 1,
2865}
2866impl MavOdidClassificationType {
2867 pub const DEFAULT: Self = Self::MAV_ODID_CLASSIFICATION_TYPE_UNDECLARED;
2868}
2869impl Default for MavOdidClassificationType {
2870 fn default() -> Self {
2871 Self::DEFAULT
2872 }
2873}
2874#[cfg_attr(feature = "ts", derive(TS))]
2875#[cfg_attr(feature = "ts", ts(export))]
2876#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2877#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2878#[cfg_attr(feature = "serde", serde(tag = "type"))]
2879#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2880#[repr(u32)]
2881pub enum MavOdidDescType {
2882 #[doc = "Optional free-form text description of the purpose of the flight."]
2883 MAV_ODID_DESC_TYPE_TEXT = 0,
2884 #[doc = "Optional additional clarification when status == MAV_ODID_STATUS_EMERGENCY."]
2885 MAV_ODID_DESC_TYPE_EMERGENCY = 1,
2886 #[doc = "Optional additional clarification when status != MAV_ODID_STATUS_EMERGENCY."]
2887 MAV_ODID_DESC_TYPE_EXTENDED_STATUS = 2,
2888}
2889impl MavOdidDescType {
2890 pub const DEFAULT: Self = Self::MAV_ODID_DESC_TYPE_TEXT;
2891}
2892impl Default for MavOdidDescType {
2893 fn default() -> Self {
2894 Self::DEFAULT
2895 }
2896}
2897#[cfg_attr(feature = "ts", derive(TS))]
2898#[cfg_attr(feature = "ts", ts(export))]
2899#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2900#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2901#[cfg_attr(feature = "serde", serde(tag = "type"))]
2902#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2903#[repr(u32)]
2904pub enum MavOdidHeightRef {
2905 #[doc = "The height field is relative to the take-off location."]
2906 MAV_ODID_HEIGHT_REF_OVER_TAKEOFF = 0,
2907 #[doc = "The height field is relative to ground."]
2908 MAV_ODID_HEIGHT_REF_OVER_GROUND = 1,
2909}
2910impl MavOdidHeightRef {
2911 pub const DEFAULT: Self = Self::MAV_ODID_HEIGHT_REF_OVER_TAKEOFF;
2912}
2913impl Default for MavOdidHeightRef {
2914 fn default() -> Self {
2915 Self::DEFAULT
2916 }
2917}
2918#[cfg_attr(feature = "ts", derive(TS))]
2919#[cfg_attr(feature = "ts", ts(export))]
2920#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2921#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2922#[cfg_attr(feature = "serde", serde(tag = "type"))]
2923#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2924#[repr(u32)]
2925pub enum MavOdidHorAcc {
2926 #[doc = "The horizontal accuracy is unknown."]
2927 MAV_ODID_HOR_ACC_UNKNOWN = 0,
2928 #[doc = "The horizontal accuracy is smaller than 10 Nautical Miles. 18.52 km."]
2929 MAV_ODID_HOR_ACC_10NM = 1,
2930 #[doc = "The horizontal accuracy is smaller than 4 Nautical Miles. 7.408 km."]
2931 MAV_ODID_HOR_ACC_4NM = 2,
2932 #[doc = "The horizontal accuracy is smaller than 2 Nautical Miles. 3.704 km."]
2933 MAV_ODID_HOR_ACC_2NM = 3,
2934 #[doc = "The horizontal accuracy is smaller than 1 Nautical Miles. 1.852 km."]
2935 MAV_ODID_HOR_ACC_1NM = 4,
2936 #[doc = "The horizontal accuracy is smaller than 0.5 Nautical Miles. 926 m."]
2937 MAV_ODID_HOR_ACC_0_5NM = 5,
2938 #[doc = "The horizontal accuracy is smaller than 0.3 Nautical Miles. 555.6 m."]
2939 MAV_ODID_HOR_ACC_0_3NM = 6,
2940 #[doc = "The horizontal accuracy is smaller than 0.1 Nautical Miles. 185.2 m."]
2941 MAV_ODID_HOR_ACC_0_1NM = 7,
2942 #[doc = "The horizontal accuracy is smaller than 0.05 Nautical Miles. 92.6 m."]
2943 MAV_ODID_HOR_ACC_0_05NM = 8,
2944 #[doc = "The horizontal accuracy is smaller than 30 meter."]
2945 MAV_ODID_HOR_ACC_30_METER = 9,
2946 #[doc = "The horizontal accuracy is smaller than 10 meter."]
2947 MAV_ODID_HOR_ACC_10_METER = 10,
2948 #[doc = "The horizontal accuracy is smaller than 3 meter."]
2949 MAV_ODID_HOR_ACC_3_METER = 11,
2950 #[doc = "The horizontal accuracy is smaller than 1 meter."]
2951 MAV_ODID_HOR_ACC_1_METER = 12,
2952}
2953impl MavOdidHorAcc {
2954 pub const DEFAULT: Self = Self::MAV_ODID_HOR_ACC_UNKNOWN;
2955}
2956impl Default for MavOdidHorAcc {
2957 fn default() -> Self {
2958 Self::DEFAULT
2959 }
2960}
2961#[cfg_attr(feature = "ts", derive(TS))]
2962#[cfg_attr(feature = "ts", ts(export))]
2963#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2964#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2965#[cfg_attr(feature = "serde", serde(tag = "type"))]
2966#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2967#[repr(u32)]
2968pub enum MavOdidIdType {
2969 #[doc = "No type defined."]
2970 MAV_ODID_ID_TYPE_NONE = 0,
2971 #[doc = "Manufacturer Serial Number (ANSI/CTA-2063 format)."]
2972 MAV_ODID_ID_TYPE_SERIAL_NUMBER = 1,
2973 #[doc = "CAA (Civil Aviation Authority) registered ID. Format: [ICAO Country Code].[CAA Assigned ID]."]
2974 MAV_ODID_ID_TYPE_CAA_REGISTRATION_ID = 2,
2975 #[doc = "UTM (Unmanned Traffic Management) assigned UUID (RFC4122)."]
2976 MAV_ODID_ID_TYPE_UTM_ASSIGNED_UUID = 3,
2977 #[doc = "A 20 byte ID for a specific flight/session. The exact ID type is indicated by the first byte of uas_id and these type values are managed by ICAO."]
2978 MAV_ODID_ID_TYPE_SPECIFIC_SESSION_ID = 4,
2979}
2980impl MavOdidIdType {
2981 pub const DEFAULT: Self = Self::MAV_ODID_ID_TYPE_NONE;
2982}
2983impl Default for MavOdidIdType {
2984 fn default() -> Self {
2985 Self::DEFAULT
2986 }
2987}
2988#[cfg_attr(feature = "ts", derive(TS))]
2989#[cfg_attr(feature = "ts", ts(export))]
2990#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2991#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2992#[cfg_attr(feature = "serde", serde(tag = "type"))]
2993#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2994#[repr(u32)]
2995pub enum MavOdidOperatorIdType {
2996 #[doc = "CAA (Civil Aviation Authority) registered operator ID."]
2997 MAV_ODID_OPERATOR_ID_TYPE_CAA = 0,
2998}
2999impl MavOdidOperatorIdType {
3000 pub const DEFAULT: Self = Self::MAV_ODID_OPERATOR_ID_TYPE_CAA;
3001}
3002impl Default for MavOdidOperatorIdType {
3003 fn default() -> Self {
3004 Self::DEFAULT
3005 }
3006}
3007#[cfg_attr(feature = "ts", derive(TS))]
3008#[cfg_attr(feature = "ts", ts(export))]
3009#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3010#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3011#[cfg_attr(feature = "serde", serde(tag = "type"))]
3012#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3013#[repr(u32)]
3014pub enum MavOdidOperatorLocationType {
3015 #[doc = "The location/altitude of the operator is the same as the take-off location."]
3016 MAV_ODID_OPERATOR_LOCATION_TYPE_TAKEOFF = 0,
3017 #[doc = "The location/altitude of the operator is dynamic. E.g. based on live GNSS data."]
3018 MAV_ODID_OPERATOR_LOCATION_TYPE_LIVE_GNSS = 1,
3019 #[doc = "The location/altitude of the operator are fixed values."]
3020 MAV_ODID_OPERATOR_LOCATION_TYPE_FIXED = 2,
3021}
3022impl MavOdidOperatorLocationType {
3023 pub const DEFAULT: Self = Self::MAV_ODID_OPERATOR_LOCATION_TYPE_TAKEOFF;
3024}
3025impl Default for MavOdidOperatorLocationType {
3026 fn default() -> Self {
3027 Self::DEFAULT
3028 }
3029}
3030#[cfg_attr(feature = "ts", derive(TS))]
3031#[cfg_attr(feature = "ts", ts(export))]
3032#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3033#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3034#[cfg_attr(feature = "serde", serde(tag = "type"))]
3035#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3036#[repr(u32)]
3037pub enum MavOdidSpeedAcc {
3038 #[doc = "The speed accuracy is unknown."]
3039 MAV_ODID_SPEED_ACC_UNKNOWN = 0,
3040 #[doc = "The speed accuracy is smaller than 10 meters per second."]
3041 MAV_ODID_SPEED_ACC_10_METERS_PER_SECOND = 1,
3042 #[doc = "The speed accuracy is smaller than 3 meters per second."]
3043 MAV_ODID_SPEED_ACC_3_METERS_PER_SECOND = 2,
3044 #[doc = "The speed accuracy is smaller than 1 meters per second."]
3045 MAV_ODID_SPEED_ACC_1_METERS_PER_SECOND = 3,
3046 #[doc = "The speed accuracy is smaller than 0.3 meters per second."]
3047 MAV_ODID_SPEED_ACC_0_3_METERS_PER_SECOND = 4,
3048}
3049impl MavOdidSpeedAcc {
3050 pub const DEFAULT: Self = Self::MAV_ODID_SPEED_ACC_UNKNOWN;
3051}
3052impl Default for MavOdidSpeedAcc {
3053 fn default() -> Self {
3054 Self::DEFAULT
3055 }
3056}
3057#[cfg_attr(feature = "ts", derive(TS))]
3058#[cfg_attr(feature = "ts", ts(export))]
3059#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3060#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3061#[cfg_attr(feature = "serde", serde(tag = "type"))]
3062#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3063#[repr(u32)]
3064pub enum MavOdidStatus {
3065 #[doc = "The status of the (UA) Unmanned Aircraft is undefined."]
3066 MAV_ODID_STATUS_UNDECLARED = 0,
3067 #[doc = "The UA is on the ground."]
3068 MAV_ODID_STATUS_GROUND = 1,
3069 #[doc = "The UA is in the air."]
3070 MAV_ODID_STATUS_AIRBORNE = 2,
3071 #[doc = "The UA is having an emergency."]
3072 MAV_ODID_STATUS_EMERGENCY = 3,
3073 #[doc = "The remote ID system is failing or unreliable in some way."]
3074 MAV_ODID_STATUS_REMOTE_ID_SYSTEM_FAILURE = 4,
3075}
3076impl MavOdidStatus {
3077 pub const DEFAULT: Self = Self::MAV_ODID_STATUS_UNDECLARED;
3078}
3079impl Default for MavOdidStatus {
3080 fn default() -> Self {
3081 Self::DEFAULT
3082 }
3083}
3084#[cfg_attr(feature = "ts", derive(TS))]
3085#[cfg_attr(feature = "ts", ts(export))]
3086#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3087#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3088#[cfg_attr(feature = "serde", serde(tag = "type"))]
3089#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3090#[repr(u32)]
3091pub enum MavOdidTimeAcc {
3092 #[doc = "The timestamp accuracy is unknown."]
3093 MAV_ODID_TIME_ACC_UNKNOWN = 0,
3094 #[doc = "The timestamp accuracy is smaller than or equal to 0.1 second."]
3095 MAV_ODID_TIME_ACC_0_1_SECOND = 1,
3096 #[doc = "The timestamp accuracy is smaller than or equal to 0.2 second."]
3097 MAV_ODID_TIME_ACC_0_2_SECOND = 2,
3098 #[doc = "The timestamp accuracy is smaller than or equal to 0.3 second."]
3099 MAV_ODID_TIME_ACC_0_3_SECOND = 3,
3100 #[doc = "The timestamp accuracy is smaller than or equal to 0.4 second."]
3101 MAV_ODID_TIME_ACC_0_4_SECOND = 4,
3102 #[doc = "The timestamp accuracy is smaller than or equal to 0.5 second."]
3103 MAV_ODID_TIME_ACC_0_5_SECOND = 5,
3104 #[doc = "The timestamp accuracy is smaller than or equal to 0.6 second."]
3105 MAV_ODID_TIME_ACC_0_6_SECOND = 6,
3106 #[doc = "The timestamp accuracy is smaller than or equal to 0.7 second."]
3107 MAV_ODID_TIME_ACC_0_7_SECOND = 7,
3108 #[doc = "The timestamp accuracy is smaller than or equal to 0.8 second."]
3109 MAV_ODID_TIME_ACC_0_8_SECOND = 8,
3110 #[doc = "The timestamp accuracy is smaller than or equal to 0.9 second."]
3111 MAV_ODID_TIME_ACC_0_9_SECOND = 9,
3112 #[doc = "The timestamp accuracy is smaller than or equal to 1.0 second."]
3113 MAV_ODID_TIME_ACC_1_0_SECOND = 10,
3114 #[doc = "The timestamp accuracy is smaller than or equal to 1.1 second."]
3115 MAV_ODID_TIME_ACC_1_1_SECOND = 11,
3116 #[doc = "The timestamp accuracy is smaller than or equal to 1.2 second."]
3117 MAV_ODID_TIME_ACC_1_2_SECOND = 12,
3118 #[doc = "The timestamp accuracy is smaller than or equal to 1.3 second."]
3119 MAV_ODID_TIME_ACC_1_3_SECOND = 13,
3120 #[doc = "The timestamp accuracy is smaller than or equal to 1.4 second."]
3121 MAV_ODID_TIME_ACC_1_4_SECOND = 14,
3122 #[doc = "The timestamp accuracy is smaller than or equal to 1.5 second."]
3123 MAV_ODID_TIME_ACC_1_5_SECOND = 15,
3124}
3125impl MavOdidTimeAcc {
3126 pub const DEFAULT: Self = Self::MAV_ODID_TIME_ACC_UNKNOWN;
3127}
3128impl Default for MavOdidTimeAcc {
3129 fn default() -> Self {
3130 Self::DEFAULT
3131 }
3132}
3133#[cfg_attr(feature = "ts", derive(TS))]
3134#[cfg_attr(feature = "ts", ts(export))]
3135#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3136#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3137#[cfg_attr(feature = "serde", serde(tag = "type"))]
3138#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3139#[repr(u32)]
3140pub enum MavOdidUaType {
3141 #[doc = "No UA (Unmanned Aircraft) type defined."]
3142 MAV_ODID_UA_TYPE_NONE = 0,
3143 #[doc = "Aeroplane/Airplane. Fixed wing."]
3144 MAV_ODID_UA_TYPE_AEROPLANE = 1,
3145 #[doc = "Helicopter or multirotor."]
3146 MAV_ODID_UA_TYPE_HELICOPTER_OR_MULTIROTOR = 2,
3147 #[doc = "Gyroplane."]
3148 MAV_ODID_UA_TYPE_GYROPLANE = 3,
3149 #[doc = "VTOL (Vertical Take-Off and Landing). Fixed wing aircraft that can take off vertically."]
3150 MAV_ODID_UA_TYPE_HYBRID_LIFT = 4,
3151 #[doc = "Ornithopter."]
3152 MAV_ODID_UA_TYPE_ORNITHOPTER = 5,
3153 #[doc = "Glider."]
3154 MAV_ODID_UA_TYPE_GLIDER = 6,
3155 #[doc = "Kite."]
3156 MAV_ODID_UA_TYPE_KITE = 7,
3157 #[doc = "Free Balloon."]
3158 MAV_ODID_UA_TYPE_FREE_BALLOON = 8,
3159 #[doc = "Captive Balloon."]
3160 MAV_ODID_UA_TYPE_CAPTIVE_BALLOON = 9,
3161 #[doc = "Airship. E.g. a blimp."]
3162 MAV_ODID_UA_TYPE_AIRSHIP = 10,
3163 #[doc = "Free Fall/Parachute (unpowered)."]
3164 MAV_ODID_UA_TYPE_FREE_FALL_PARACHUTE = 11,
3165 #[doc = "Rocket."]
3166 MAV_ODID_UA_TYPE_ROCKET = 12,
3167 #[doc = "Tethered powered aircraft."]
3168 MAV_ODID_UA_TYPE_TETHERED_POWERED_AIRCRAFT = 13,
3169 #[doc = "Ground Obstacle."]
3170 MAV_ODID_UA_TYPE_GROUND_OBSTACLE = 14,
3171 #[doc = "Other type of aircraft not listed earlier."]
3172 MAV_ODID_UA_TYPE_OTHER = 15,
3173}
3174impl MavOdidUaType {
3175 pub const DEFAULT: Self = Self::MAV_ODID_UA_TYPE_NONE;
3176}
3177impl Default for MavOdidUaType {
3178 fn default() -> Self {
3179 Self::DEFAULT
3180 }
3181}
3182#[cfg_attr(feature = "ts", derive(TS))]
3183#[cfg_attr(feature = "ts", ts(export))]
3184#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3185#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3186#[cfg_attr(feature = "serde", serde(tag = "type"))]
3187#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3188#[repr(u32)]
3189pub enum MavOdidVerAcc {
3190 #[doc = "The vertical accuracy is unknown."]
3191 MAV_ODID_VER_ACC_UNKNOWN = 0,
3192 #[doc = "The vertical accuracy is smaller than 150 meter."]
3193 MAV_ODID_VER_ACC_150_METER = 1,
3194 #[doc = "The vertical accuracy is smaller than 45 meter."]
3195 MAV_ODID_VER_ACC_45_METER = 2,
3196 #[doc = "The vertical accuracy is smaller than 25 meter."]
3197 MAV_ODID_VER_ACC_25_METER = 3,
3198 #[doc = "The vertical accuracy is smaller than 10 meter."]
3199 MAV_ODID_VER_ACC_10_METER = 4,
3200 #[doc = "The vertical accuracy is smaller than 3 meter."]
3201 MAV_ODID_VER_ACC_3_METER = 5,
3202 #[doc = "The vertical accuracy is smaller than 1 meter."]
3203 MAV_ODID_VER_ACC_1_METER = 6,
3204}
3205impl MavOdidVerAcc {
3206 pub const DEFAULT: Self = Self::MAV_ODID_VER_ACC_UNKNOWN;
3207}
3208impl Default for MavOdidVerAcc {
3209 fn default() -> Self {
3210 Self::DEFAULT
3211 }
3212}
3213#[cfg_attr(feature = "ts", derive(TS))]
3214#[cfg_attr(feature = "ts", ts(export))]
3215#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3216#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3217#[cfg_attr(feature = "serde", serde(tag = "type"))]
3218#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3219#[repr(u32)]
3220#[doc = "Specifies the datatype of a MAVLink extended parameter."]
3221pub enum MavParamExtType {
3222 #[doc = "8-bit unsigned integer"]
3223 MAV_PARAM_EXT_TYPE_UINT8 = 1,
3224 #[doc = "8-bit signed integer"]
3225 MAV_PARAM_EXT_TYPE_INT8 = 2,
3226 #[doc = "16-bit unsigned integer"]
3227 MAV_PARAM_EXT_TYPE_UINT16 = 3,
3228 #[doc = "16-bit signed integer"]
3229 MAV_PARAM_EXT_TYPE_INT16 = 4,
3230 #[doc = "32-bit unsigned integer"]
3231 MAV_PARAM_EXT_TYPE_UINT32 = 5,
3232 #[doc = "32-bit signed integer"]
3233 MAV_PARAM_EXT_TYPE_INT32 = 6,
3234 #[doc = "64-bit unsigned integer"]
3235 MAV_PARAM_EXT_TYPE_UINT64 = 7,
3236 #[doc = "64-bit signed integer"]
3237 MAV_PARAM_EXT_TYPE_INT64 = 8,
3238 #[doc = "32-bit floating-point"]
3239 MAV_PARAM_EXT_TYPE_REAL32 = 9,
3240 #[doc = "64-bit floating-point"]
3241 MAV_PARAM_EXT_TYPE_REAL64 = 10,
3242 #[doc = "Custom Type"]
3243 MAV_PARAM_EXT_TYPE_CUSTOM = 11,
3244}
3245impl MavParamExtType {
3246 pub const DEFAULT: Self = Self::MAV_PARAM_EXT_TYPE_UINT8;
3247}
3248impl Default for MavParamExtType {
3249 fn default() -> Self {
3250 Self::DEFAULT
3251 }
3252}
3253#[cfg_attr(feature = "ts", derive(TS))]
3254#[cfg_attr(feature = "ts", ts(export))]
3255#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3256#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3257#[cfg_attr(feature = "serde", serde(tag = "type"))]
3258#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3259#[repr(u32)]
3260#[doc = "Specifies the datatype of a MAVLink parameter."]
3261pub enum MavParamType {
3262 #[doc = "8-bit unsigned integer"]
3263 MAV_PARAM_TYPE_UINT8 = 1,
3264 #[doc = "8-bit signed integer"]
3265 MAV_PARAM_TYPE_INT8 = 2,
3266 #[doc = "16-bit unsigned integer"]
3267 MAV_PARAM_TYPE_UINT16 = 3,
3268 #[doc = "16-bit signed integer"]
3269 MAV_PARAM_TYPE_INT16 = 4,
3270 #[doc = "32-bit unsigned integer"]
3271 MAV_PARAM_TYPE_UINT32 = 5,
3272 #[doc = "32-bit signed integer"]
3273 MAV_PARAM_TYPE_INT32 = 6,
3274 #[doc = "64-bit unsigned integer"]
3275 MAV_PARAM_TYPE_UINT64 = 7,
3276 #[doc = "64-bit signed integer"]
3277 MAV_PARAM_TYPE_INT64 = 8,
3278 #[doc = "32-bit floating-point"]
3279 MAV_PARAM_TYPE_REAL32 = 9,
3280 #[doc = "64-bit floating-point"]
3281 MAV_PARAM_TYPE_REAL64 = 10,
3282}
3283impl MavParamType {
3284 pub const DEFAULT: Self = Self::MAV_PARAM_TYPE_UINT8;
3285}
3286impl Default for MavParamType {
3287 fn default() -> Self {
3288 Self::DEFAULT
3289 }
3290}
3291bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Power supply status flags (bitmask)"] pub struct MavPowerStatus : u16 { # [doc = "main brick power supply valid"] const MAV_POWER_STATUS_BRICK_VALID = 1 ; # [doc = "main servo power supply valid for FMU"] const MAV_POWER_STATUS_SERVO_VALID = 2 ; # [doc = "USB power is connected"] const MAV_POWER_STATUS_USB_CONNECTED = 4 ; # [doc = "peripheral supply is in over-current state"] const MAV_POWER_STATUS_PERIPH_OVERCURRENT = 8 ; # [doc = "hi-power peripheral supply is in over-current state"] const MAV_POWER_STATUS_PERIPH_HIPOWER_OVERCURRENT = 16 ; # [doc = "Power status has changed since boot"] const MAV_POWER_STATUS_CHANGED = 32 ; } }
3292impl MavPowerStatus {
3293 pub const DEFAULT: Self = Self::MAV_POWER_STATUS_BRICK_VALID;
3294}
3295impl Default for MavPowerStatus {
3296 fn default() -> Self {
3297 Self::DEFAULT
3298 }
3299}
3300bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Bitmask of (optional) autopilot capabilities (64 bit). If a bit is set, the autopilot supports this capability."] pub struct MavProtocolCapability : u64 { # [doc = "Autopilot supports the MISSION_ITEM float message type. Note that MISSION_ITEM is deprecated, and autopilots should use MISSION_INT instead."] const MAV_PROTOCOL_CAPABILITY_MISSION_FLOAT = 1 ; # [deprecated = " See `MAV_PROTOCOL_CAPABILITY_PARAM_ENCODE_C_CAST` (Deprecated since 2022-03)"] # [doc = "Autopilot supports the new param float message type."] const MAV_PROTOCOL_CAPABILITY_PARAM_FLOAT = 2 ; # [doc = "Autopilot supports MISSION_ITEM_INT scaled integer message type. Note that this flag must always be set if missions are supported, because missions must always use MISSION_ITEM_INT (rather than MISSION_ITEM, which is deprecated)."] const MAV_PROTOCOL_CAPABILITY_MISSION_INT = 4 ; # [doc = "Autopilot supports COMMAND_INT scaled integer message type."] const MAV_PROTOCOL_CAPABILITY_COMMAND_INT = 8 ; # [doc = "Parameter protocol uses byte-wise encoding of parameter values into param_value (float) fields: <https://mavlink.io/en/services/parameter.html#parameter-encoding>. Note that either this flag or MAV_PROTOCOL_CAPABILITY_PARAM_ENCODE_C_CAST should be set if the parameter protocol is supported."] const MAV_PROTOCOL_CAPABILITY_PARAM_ENCODE_BYTEWISE = 16 ; # [doc = "Autopilot supports the File Transfer Protocol v1: <https://mavlink.io/en/services/ftp.html>."] const MAV_PROTOCOL_CAPABILITY_FTP = 32 ; # [doc = "Autopilot supports commanding attitude offboard."] const MAV_PROTOCOL_CAPABILITY_SET_ATTITUDE_TARGET = 64 ; # [doc = "Autopilot supports commanding position and velocity targets in local NED frame."] const MAV_PROTOCOL_CAPABILITY_SET_POSITION_TARGET_LOCAL_NED = 128 ; # [doc = "Autopilot supports commanding position and velocity targets in global scaled integers."] const MAV_PROTOCOL_CAPABILITY_SET_POSITION_TARGET_GLOBAL_INT = 256 ; # [doc = "Autopilot supports terrain protocol / data handling."] const MAV_PROTOCOL_CAPABILITY_TERRAIN = 512 ; # [doc = "Reserved for future use."] const MAV_PROTOCOL_CAPABILITY_RESERVED3 = 1024 ; # [doc = "Autopilot supports the MAV_CMD_DO_FLIGHTTERMINATION command (flight termination)."] const MAV_PROTOCOL_CAPABILITY_FLIGHT_TERMINATION = 2048 ; # [doc = "Autopilot supports onboard compass calibration."] const MAV_PROTOCOL_CAPABILITY_COMPASS_CALIBRATION = 4096 ; # [doc = "Autopilot supports MAVLink version 2."] const MAV_PROTOCOL_CAPABILITY_MAVLINK2 = 8192 ; # [doc = "Autopilot supports mission fence protocol."] const MAV_PROTOCOL_CAPABILITY_MISSION_FENCE = 16384 ; # [doc = "Autopilot supports mission rally point protocol."] const MAV_PROTOCOL_CAPABILITY_MISSION_RALLY = 32768 ; # [doc = "Reserved for future use."] const MAV_PROTOCOL_CAPABILITY_RESERVED2 = 65536 ; # [doc = "Parameter protocol uses C-cast of parameter values to set the param_value (float) fields: <https://mavlink.io/en/services/parameter.html#parameter-encoding>. Note that either this flag or MAV_PROTOCOL_CAPABILITY_PARAM_ENCODE_BYTEWISE should be set if the parameter protocol is supported."] const MAV_PROTOCOL_CAPABILITY_PARAM_ENCODE_C_CAST = 131072 ; # [doc = "This component implements/is a gimbal manager. This means the GIMBAL_MANAGER_INFORMATION, and other messages can be requested."] const MAV_PROTOCOL_CAPABILITY_COMPONENT_IMPLEMENTS_GIMBAL_MANAGER = 262144 ; # [doc = "Component supports locking control to a particular GCS independent of its system (via MAV_CMD_REQUEST_OPERATOR_CONTROL)."] const MAV_PROTOCOL_CAPABILITY_COMPONENT_ACCEPTS_GCS_CONTROL = 524288 ; } }
3301impl MavProtocolCapability {
3302 pub const DEFAULT: Self = Self::MAV_PROTOCOL_CAPABILITY_MISSION_FLOAT;
3303}
3304impl Default for MavProtocolCapability {
3305 fn default() -> Self {
3306 Self::DEFAULT
3307 }
3308}
3309#[cfg_attr(feature = "ts", derive(TS))]
3310#[cfg_attr(feature = "ts", ts(export))]
3311#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3312#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3313#[cfg_attr(feature = "serde", serde(tag = "type"))]
3314#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3315#[repr(u32)]
3316#[doc = "Result from a MAVLink command (MAV_CMD)"]
3317pub enum MavResult {
3318 #[doc = "Command is valid (is supported and has valid parameters), and was executed."]
3319 MAV_RESULT_ACCEPTED = 0,
3320 #[doc = "Command is valid, but cannot be executed at this time. This is used to indicate a problem that should be fixed just by waiting (e.g. a state machine is busy, can't arm because have not got GPS lock, etc.). Retrying later should work."]
3321 MAV_RESULT_TEMPORARILY_REJECTED = 1,
3322 #[doc = "Command is invalid (is supported but has invalid parameters). Retrying same command and parameters will not work."]
3323 MAV_RESULT_DENIED = 2,
3324 #[doc = "Command is not supported (unknown)."]
3325 MAV_RESULT_UNSUPPORTED = 3,
3326 #[doc = "Command is valid, but execution has failed. This is used to indicate any non-temporary or unexpected problem, i.e. any problem that must be fixed before the command can succeed/be retried. For example, attempting to write a file when out of memory, attempting to arm when sensors are not calibrated, etc."]
3327 MAV_RESULT_FAILED = 4,
3328 #[doc = "Command is valid and is being executed. This will be followed by further progress updates, i.e. the component may send further COMMAND_ACK messages with result MAV_RESULT_IN_PROGRESS (at a rate decided by the implementation), and must terminate by sending a COMMAND_ACK message with final result of the operation. The COMMAND_ACK.progress field can be used to indicate the progress of the operation."]
3329 MAV_RESULT_IN_PROGRESS = 5,
3330 #[doc = "Command has been cancelled (as a result of receiving a COMMAND_CANCEL message)."]
3331 MAV_RESULT_CANCELLED = 6,
3332 #[doc = "Command is only accepted when sent as a COMMAND_LONG."]
3333 MAV_RESULT_COMMAND_LONG_ONLY = 7,
3334 #[doc = "Command is only accepted when sent as a COMMAND_INT."]
3335 MAV_RESULT_COMMAND_INT_ONLY = 8,
3336 #[doc = "Command is invalid because a frame is required and the specified frame is not supported."]
3337 MAV_RESULT_COMMAND_UNSUPPORTED_MAV_FRAME = 9,
3338}
3339impl MavResult {
3340 pub const DEFAULT: Self = Self::MAV_RESULT_ACCEPTED;
3341}
3342impl Default for MavResult {
3343 fn default() -> Self {
3344 Self::DEFAULT
3345 }
3346}
3347#[cfg_attr(feature = "ts", derive(TS))]
3348#[cfg_attr(feature = "ts", ts(export))]
3349#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3350#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3351#[cfg_attr(feature = "serde", serde(tag = "type"))]
3352#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3353#[repr(u32)]
3354#[deprecated = " See `MAV_CMD_DO_SET_ROI_*` (Deprecated since 2018-01)"]
3355#[doc = "The ROI (region of interest) for the vehicle. This can be be used by the vehicle for camera/vehicle attitude alignment (see MAV_CMD_NAV_ROI)."]
3356pub enum MavRoi {
3357 #[doc = "No region of interest."]
3358 MAV_ROI_NONE = 0,
3359 #[doc = "Point toward next waypoint, with optional pitch/roll/yaw offset."]
3360 MAV_ROI_WPNEXT = 1,
3361 #[doc = "Point toward given waypoint."]
3362 MAV_ROI_WPINDEX = 2,
3363 #[doc = "Point toward fixed location."]
3364 MAV_ROI_LOCATION = 3,
3365 #[doc = "Point toward of given id."]
3366 MAV_ROI_TARGET = 4,
3367}
3368impl MavRoi {
3369 pub const DEFAULT: Self = Self::MAV_ROI_NONE;
3370}
3371impl Default for MavRoi {
3372 fn default() -> Self {
3373 Self::DEFAULT
3374 }
3375}
3376#[cfg_attr(feature = "ts", derive(TS))]
3377#[cfg_attr(feature = "ts", ts(export))]
3378#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3379#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3380#[cfg_attr(feature = "serde", serde(tag = "type"))]
3381#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3382#[repr(u32)]
3383#[doc = "Enumeration of sensor orientation, according to its rotations"]
3384pub enum MavSensorOrientation {
3385 #[doc = "Roll: 0, Pitch: 0, Yaw: 0"]
3386 MAV_SENSOR_ROTATION_NONE = 0,
3387 #[doc = "Roll: 0, Pitch: 0, Yaw: 45"]
3388 MAV_SENSOR_ROTATION_YAW_45 = 1,
3389 #[doc = "Roll: 0, Pitch: 0, Yaw: 90"]
3390 MAV_SENSOR_ROTATION_YAW_90 = 2,
3391 #[doc = "Roll: 0, Pitch: 0, Yaw: 135"]
3392 MAV_SENSOR_ROTATION_YAW_135 = 3,
3393 #[doc = "Roll: 0, Pitch: 0, Yaw: 180"]
3394 MAV_SENSOR_ROTATION_YAW_180 = 4,
3395 #[doc = "Roll: 0, Pitch: 0, Yaw: 225"]
3396 MAV_SENSOR_ROTATION_YAW_225 = 5,
3397 #[doc = "Roll: 0, Pitch: 0, Yaw: 270"]
3398 MAV_SENSOR_ROTATION_YAW_270 = 6,
3399 #[doc = "Roll: 0, Pitch: 0, Yaw: 315"]
3400 MAV_SENSOR_ROTATION_YAW_315 = 7,
3401 #[doc = "Roll: 180, Pitch: 0, Yaw: 0"]
3402 MAV_SENSOR_ROTATION_ROLL_180 = 8,
3403 #[doc = "Roll: 180, Pitch: 0, Yaw: 45"]
3404 MAV_SENSOR_ROTATION_ROLL_180_YAW_45 = 9,
3405 #[doc = "Roll: 180, Pitch: 0, Yaw: 90"]
3406 MAV_SENSOR_ROTATION_ROLL_180_YAW_90 = 10,
3407 #[doc = "Roll: 180, Pitch: 0, Yaw: 135"]
3408 MAV_SENSOR_ROTATION_ROLL_180_YAW_135 = 11,
3409 #[doc = "Roll: 0, Pitch: 180, Yaw: 0"]
3410 MAV_SENSOR_ROTATION_PITCH_180 = 12,
3411 #[doc = "Roll: 180, Pitch: 0, Yaw: 225"]
3412 MAV_SENSOR_ROTATION_ROLL_180_YAW_225 = 13,
3413 #[doc = "Roll: 180, Pitch: 0, Yaw: 270"]
3414 MAV_SENSOR_ROTATION_ROLL_180_YAW_270 = 14,
3415 #[doc = "Roll: 180, Pitch: 0, Yaw: 315"]
3416 MAV_SENSOR_ROTATION_ROLL_180_YAW_315 = 15,
3417 #[doc = "Roll: 90, Pitch: 0, Yaw: 0"]
3418 MAV_SENSOR_ROTATION_ROLL_90 = 16,
3419 #[doc = "Roll: 90, Pitch: 0, Yaw: 45"]
3420 MAV_SENSOR_ROTATION_ROLL_90_YAW_45 = 17,
3421 #[doc = "Roll: 90, Pitch: 0, Yaw: 90"]
3422 MAV_SENSOR_ROTATION_ROLL_90_YAW_90 = 18,
3423 #[doc = "Roll: 90, Pitch: 0, Yaw: 135"]
3424 MAV_SENSOR_ROTATION_ROLL_90_YAW_135 = 19,
3425 #[doc = "Roll: 270, Pitch: 0, Yaw: 0"]
3426 MAV_SENSOR_ROTATION_ROLL_270 = 20,
3427 #[doc = "Roll: 270, Pitch: 0, Yaw: 45"]
3428 MAV_SENSOR_ROTATION_ROLL_270_YAW_45 = 21,
3429 #[doc = "Roll: 270, Pitch: 0, Yaw: 90"]
3430 MAV_SENSOR_ROTATION_ROLL_270_YAW_90 = 22,
3431 #[doc = "Roll: 270, Pitch: 0, Yaw: 135"]
3432 MAV_SENSOR_ROTATION_ROLL_270_YAW_135 = 23,
3433 #[doc = "Roll: 0, Pitch: 90, Yaw: 0"]
3434 MAV_SENSOR_ROTATION_PITCH_90 = 24,
3435 #[doc = "Roll: 0, Pitch: 270, Yaw: 0"]
3436 MAV_SENSOR_ROTATION_PITCH_270 = 25,
3437 #[doc = "Roll: 0, Pitch: 180, Yaw: 90"]
3438 MAV_SENSOR_ROTATION_PITCH_180_YAW_90 = 26,
3439 #[doc = "Roll: 0, Pitch: 180, Yaw: 270"]
3440 MAV_SENSOR_ROTATION_PITCH_180_YAW_270 = 27,
3441 #[doc = "Roll: 90, Pitch: 90, Yaw: 0"]
3442 MAV_SENSOR_ROTATION_ROLL_90_PITCH_90 = 28,
3443 #[doc = "Roll: 180, Pitch: 90, Yaw: 0"]
3444 MAV_SENSOR_ROTATION_ROLL_180_PITCH_90 = 29,
3445 #[doc = "Roll: 270, Pitch: 90, Yaw: 0"]
3446 MAV_SENSOR_ROTATION_ROLL_270_PITCH_90 = 30,
3447 #[doc = "Roll: 90, Pitch: 180, Yaw: 0"]
3448 MAV_SENSOR_ROTATION_ROLL_90_PITCH_180 = 31,
3449 #[doc = "Roll: 270, Pitch: 180, Yaw: 0"]
3450 MAV_SENSOR_ROTATION_ROLL_270_PITCH_180 = 32,
3451 #[doc = "Roll: 90, Pitch: 270, Yaw: 0"]
3452 MAV_SENSOR_ROTATION_ROLL_90_PITCH_270 = 33,
3453 #[doc = "Roll: 180, Pitch: 270, Yaw: 0"]
3454 MAV_SENSOR_ROTATION_ROLL_180_PITCH_270 = 34,
3455 #[doc = "Roll: 270, Pitch: 270, Yaw: 0"]
3456 MAV_SENSOR_ROTATION_ROLL_270_PITCH_270 = 35,
3457 #[doc = "Roll: 90, Pitch: 180, Yaw: 90"]
3458 MAV_SENSOR_ROTATION_ROLL_90_PITCH_180_YAW_90 = 36,
3459 #[doc = "Roll: 90, Pitch: 0, Yaw: 270"]
3460 MAV_SENSOR_ROTATION_ROLL_90_YAW_270 = 37,
3461 #[doc = "Roll: 90, Pitch: 68, Yaw: 293"]
3462 MAV_SENSOR_ROTATION_ROLL_90_PITCH_68_YAW_293 = 38,
3463 #[doc = "Pitch: 315"]
3464 MAV_SENSOR_ROTATION_PITCH_315 = 39,
3465 #[doc = "Roll: 90, Pitch: 315"]
3466 MAV_SENSOR_ROTATION_ROLL_90_PITCH_315 = 40,
3467 #[doc = "Custom orientation"]
3468 MAV_SENSOR_ROTATION_CUSTOM = 100,
3469}
3470impl MavSensorOrientation {
3471 pub const DEFAULT: Self = Self::MAV_SENSOR_ROTATION_NONE;
3472}
3473impl Default for MavSensorOrientation {
3474 fn default() -> Self {
3475 Self::DEFAULT
3476 }
3477}
3478#[cfg_attr(feature = "ts", derive(TS))]
3479#[cfg_attr(feature = "ts", ts(export))]
3480#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3481#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3482#[cfg_attr(feature = "serde", serde(tag = "type"))]
3483#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3484#[repr(u32)]
3485#[doc = "Indicates the severity level, generally used for status messages to indicate their relative urgency. Based on RFC-5424 using expanded definitions at: <http://www.kiwisyslog.com/kb/info:-syslog-message-levels/>."]
3486pub enum MavSeverity {
3487 #[doc = "System is unusable. This is a \"panic\" condition."]
3488 MAV_SEVERITY_EMERGENCY = 0,
3489 #[doc = "Action should be taken immediately. Indicates error in non-critical systems."]
3490 MAV_SEVERITY_ALERT = 1,
3491 #[doc = "Action must be taken immediately. Indicates failure in a primary system."]
3492 MAV_SEVERITY_CRITICAL = 2,
3493 #[doc = "Indicates an error in secondary/redundant systems."]
3494 MAV_SEVERITY_ERROR = 3,
3495 #[doc = "Indicates about a possible future error if this is not resolved within a given timeframe. Example would be a low battery warning."]
3496 MAV_SEVERITY_WARNING = 4,
3497 #[doc = "An unusual event has occurred, though not an error condition. This should be investigated for the root cause."]
3498 MAV_SEVERITY_NOTICE = 5,
3499 #[doc = "Normal operational messages. Useful for logging. No action is required for these messages."]
3500 MAV_SEVERITY_INFO = 6,
3501 #[doc = "Useful non-operational messages that can assist in debugging. These should not occur during normal operation."]
3502 MAV_SEVERITY_DEBUG = 7,
3503}
3504impl MavSeverity {
3505 pub const DEFAULT: Self = Self::MAV_SEVERITY_EMERGENCY;
3506}
3507impl Default for MavSeverity {
3508 fn default() -> Self {
3509 Self::DEFAULT
3510 }
3511}
3512#[cfg_attr(feature = "ts", derive(TS))]
3513#[cfg_attr(feature = "ts", ts(export))]
3514#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3515#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3516#[cfg_attr(feature = "serde", serde(tag = "type"))]
3517#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3518#[repr(u32)]
3519#[doc = "Standard modes with a well understood meaning across flight stacks and vehicle types. For example, most flight stack have the concept of a \"return\" or \"RTL\" mode that takes a vehicle to safety, even though the precise mechanics of this mode may differ. The modes supported by a flight stack can be queried using AVAILABLE_MODES and set using MAV_CMD_DO_SET_STANDARD_MODE. The current mode is streamed in CURRENT_MODE. See <https://mavlink.io/en/services/standard_modes.html>"]
3520pub enum MavStandardMode {
3521 #[doc = "Non standard mode. This may be used when reporting the mode if the current flight mode is not a standard mode."]
3522 MAV_STANDARD_MODE_NON_STANDARD = 0,
3523 #[doc = "Position mode (manual). Position-controlled and stabilized manual mode. When sticks are released vehicles return to their level-flight orientation and hold both position and altitude against wind and external forces. This mode can only be set by vehicles that can hold a fixed position. Multicopter (MC) vehicles actively brake and hold both position and altitude against wind and external forces. Hybrid MC/FW (\"VTOL\") vehicles first transition to multicopter mode (if needed) but otherwise behave in the same way as MC vehicles. Fixed-wing (FW) vehicles must not support this mode. Other vehicle types must not support this mode (this may be revisited through the PR process)."]
3524 MAV_STANDARD_MODE_POSITION_HOLD = 1,
3525 #[doc = "Orbit (manual). Position-controlled and stabilized manual mode. The vehicle circles around a fixed setpoint in the horizontal plane at a particular radius, altitude, and direction. Flight stacks may further allow manual control over the setpoint position, radius, direction, speed, and/or altitude of the circle, but this is not mandated. Flight stacks may support the [MAV_CMD_DO_ORBIT](<https://mavlink.io/en/messages/common.html#MAV_CMD_DO_ORBIT>) for changing the orbit parameters. MC and FW vehicles may support this mode. Hybrid MC/FW (\"VTOL\") vehicles may support this mode in MC/FW or both modes; if the mode is not supported by the current configuration the vehicle should transition to the supported configuration. Other vehicle types must not support this mode (this may be revisited through the PR process)."]
3526 MAV_STANDARD_MODE_ORBIT = 2,
3527 #[doc = "Cruise mode (manual). Position-controlled and stabilized manual mode. When sticks are released vehicles return to their level-flight orientation and hold their original track against wind and external forces. Fixed-wing (FW) vehicles level orientation and maintain current track and altitude against wind and external forces. Hybrid MC/FW (\"VTOL\") vehicles first transition to FW mode (if needed) but otherwise behave in the same way as MC vehicles. Multicopter (MC) vehicles must not support this mode. Other vehicle types must not support this mode (this may be revisited through the PR process)."]
3528 MAV_STANDARD_MODE_CRUISE = 3,
3529 #[doc = "Altitude hold (manual). Altitude-controlled and stabilized manual mode. When sticks are released vehicles return to their level-flight orientation and hold their altitude. MC vehicles continue with existing momentum and may move with wind (or other external forces). FW vehicles continue with current heading, but may be moved off-track by wind. Hybrid MC/FW (\"VTOL\") vehicles behave according to their current configuration/mode (FW or MC). Other vehicle types must not support this mode (this may be revisited through the PR process)."]
3530 MAV_STANDARD_MODE_ALTITUDE_HOLD = 4,
3531 #[doc = "Safe recovery mode (auto). Automatic mode that takes vehicle to a predefined safe location via a safe flight path, and may also automatically land the vehicle. This mode is more commonly referred to as RTL and/or or Smart RTL. The precise return location, flight path, and landing behaviour depend on vehicle configuration and type. For example, the vehicle might return to the home/launch location, a rally point, or the start of a mission landing, it might follow a direct path, mission path, or breadcrumb path, and land using a mission landing pattern or some other kind of descent."]
3532 MAV_STANDARD_MODE_SAFE_RECOVERY = 5,
3533 #[doc = "Mission mode (automatic). Automatic mode that executes MAVLink missions. Missions are executed from the current waypoint as soon as the mode is enabled."]
3534 MAV_STANDARD_MODE_MISSION = 6,
3535 #[doc = "Land mode (auto). Automatic mode that lands the vehicle at the current location. The precise landing behaviour depends on vehicle configuration and type."]
3536 MAV_STANDARD_MODE_LAND = 7,
3537 #[doc = "Takeoff mode (auto). Automatic takeoff mode. The precise takeoff behaviour depends on vehicle configuration and type."]
3538 MAV_STANDARD_MODE_TAKEOFF = 8,
3539}
3540impl MavStandardMode {
3541 pub const DEFAULT: Self = Self::MAV_STANDARD_MODE_NON_STANDARD;
3542}
3543impl Default for MavStandardMode {
3544 fn default() -> Self {
3545 Self::DEFAULT
3546 }
3547}
3548#[cfg_attr(feature = "ts", derive(TS))]
3549#[cfg_attr(feature = "ts", ts(export))]
3550#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3551#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3552#[cfg_attr(feature = "serde", serde(tag = "type"))]
3553#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3554#[repr(u32)]
3555pub enum MavState {
3556 #[doc = "Uninitialized system, state is unknown."]
3557 MAV_STATE_UNINIT = 0,
3558 #[doc = "System is booting up."]
3559 MAV_STATE_BOOT = 1,
3560 #[doc = "System is calibrating and not flight-ready."]
3561 MAV_STATE_CALIBRATING = 2,
3562 #[doc = "System is grounded and on standby. It can be launched any time."]
3563 MAV_STATE_STANDBY = 3,
3564 #[doc = "System is active and might be already airborne. Motors are engaged."]
3565 MAV_STATE_ACTIVE = 4,
3566 #[doc = "System is in a non-normal flight mode (failsafe). It can however still navigate."]
3567 MAV_STATE_CRITICAL = 5,
3568 #[doc = "System is in a non-normal flight mode (failsafe). It lost control over parts or over the whole airframe. It is in mayday and going down."]
3569 MAV_STATE_EMERGENCY = 6,
3570 #[doc = "System just initialized its power-down sequence, will shut down now."]
3571 MAV_STATE_POWEROFF = 7,
3572 #[doc = "System is terminating itself (failsafe or commanded)."]
3573 MAV_STATE_FLIGHT_TERMINATION = 8,
3574}
3575impl MavState {
3576 pub const DEFAULT: Self = Self::MAV_STATE_UNINIT;
3577}
3578impl Default for MavState {
3579 fn default() -> Self {
3580 Self::DEFAULT
3581 }
3582}
3583bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "These encode the sensors whose status is sent as part of the SYS_STATUS message."] pub struct MavSysStatusSensor : u32 { # [doc = "0x01 3D gyro"] const MAV_SYS_STATUS_SENSOR_3D_GYRO = 1 ; # [doc = "0x02 3D accelerometer"] const MAV_SYS_STATUS_SENSOR_3D_ACCEL = 2 ; # [doc = "0x04 3D magnetometer"] const MAV_SYS_STATUS_SENSOR_3D_MAG = 4 ; # [doc = "0x08 absolute pressure"] const MAV_SYS_STATUS_SENSOR_ABSOLUTE_PRESSURE = 8 ; # [doc = "0x10 differential pressure"] const MAV_SYS_STATUS_SENSOR_DIFFERENTIAL_PRESSURE = 16 ; # [doc = "0x20 GPS"] const MAV_SYS_STATUS_SENSOR_GPS = 32 ; # [doc = "0x40 optical flow"] const MAV_SYS_STATUS_SENSOR_OPTICAL_FLOW = 64 ; # [doc = "0x80 computer vision position"] const MAV_SYS_STATUS_SENSOR_VISION_POSITION = 128 ; # [doc = "0x100 laser based position"] const MAV_SYS_STATUS_SENSOR_LASER_POSITION = 256 ; # [doc = "0x200 external ground truth (Vicon or Leica)"] const MAV_SYS_STATUS_SENSOR_EXTERNAL_GROUND_TRUTH = 512 ; # [doc = "0x400 3D angular rate control"] const MAV_SYS_STATUS_SENSOR_ANGULAR_RATE_CONTROL = 1024 ; # [doc = "0x800 attitude stabilization"] const MAV_SYS_STATUS_SENSOR_ATTITUDE_STABILIZATION = 2048 ; # [doc = "0x1000 yaw position"] const MAV_SYS_STATUS_SENSOR_YAW_POSITION = 4096 ; # [doc = "0x2000 z/altitude control"] const MAV_SYS_STATUS_SENSOR_Z_ALTITUDE_CONTROL = 8192 ; # [doc = "0x4000 x/y position control"] const MAV_SYS_STATUS_SENSOR_XY_POSITION_CONTROL = 16384 ; # [doc = "0x8000 motor outputs / control"] const MAV_SYS_STATUS_SENSOR_MOTOR_OUTPUTS = 32768 ; # [doc = "0x10000 RC receiver"] const MAV_SYS_STATUS_SENSOR_RC_RECEIVER = 65536 ; # [doc = "0x20000 2nd 3D gyro"] const MAV_SYS_STATUS_SENSOR_3D_GYRO2 = 131072 ; # [doc = "0x40000 2nd 3D accelerometer"] const MAV_SYS_STATUS_SENSOR_3D_ACCEL2 = 262144 ; # [doc = "0x80000 2nd 3D magnetometer"] const MAV_SYS_STATUS_SENSOR_3D_MAG2 = 524288 ; # [doc = "0x100000 geofence"] const MAV_SYS_STATUS_GEOFENCE = 1048576 ; # [doc = "0x200000 AHRS subsystem health"] const MAV_SYS_STATUS_AHRS = 2097152 ; # [doc = "0x400000 Terrain subsystem health"] const MAV_SYS_STATUS_TERRAIN = 4194304 ; # [doc = "0x800000 Motors are reversed"] const MAV_SYS_STATUS_REVERSE_MOTOR = 8388608 ; # [doc = "0x1000000 Logging"] const MAV_SYS_STATUS_LOGGING = 16777216 ; # [doc = "0x2000000 Battery"] const MAV_SYS_STATUS_SENSOR_BATTERY = 33554432 ; # [doc = "0x4000000 Proximity"] const MAV_SYS_STATUS_SENSOR_PROXIMITY = 67108864 ; # [doc = "0x8000000 Satellite Communication"] const MAV_SYS_STATUS_SENSOR_SATCOM = 134217728 ; # [doc = "0x10000000 pre-arm check status. Always healthy when armed"] const MAV_SYS_STATUS_PREARM_CHECK = 268435456 ; # [doc = "0x20000000 Avoidance/collision prevention"] const MAV_SYS_STATUS_OBSTACLE_AVOIDANCE = 536870912 ; # [doc = "0x40000000 propulsion (actuator, esc, motor or propellor)"] const MAV_SYS_STATUS_SENSOR_PROPULSION = 1073741824 ; # [doc = "0x80000000 Extended bit-field are used for further sensor status bits (needs to be set in onboard_control_sensors_present only)"] const MAV_SYS_STATUS_EXTENSION_USED = 2147483648 ; } }
3584impl MavSysStatusSensor {
3585 pub const DEFAULT: Self = Self::MAV_SYS_STATUS_SENSOR_3D_GYRO;
3586}
3587impl Default for MavSysStatusSensor {
3588 fn default() -> Self {
3589 Self::DEFAULT
3590 }
3591}
3592bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "These encode the sensors whose status is sent as part of the SYS_STATUS message in the extended fields."] pub struct MavSysStatusSensorExtended : u32 { # [doc = "0x01 Recovery system (parachute, balloon, retracts etc)"] const MAV_SYS_STATUS_RECOVERY_SYSTEM = 1 ; } }
3593impl MavSysStatusSensorExtended {
3594 pub const DEFAULT: Self = Self::MAV_SYS_STATUS_RECOVERY_SYSTEM;
3595}
3596impl Default for MavSysStatusSensorExtended {
3597 fn default() -> Self {
3598 Self::DEFAULT
3599 }
3600}
3601#[cfg_attr(feature = "ts", derive(TS))]
3602#[cfg_attr(feature = "ts", ts(export))]
3603#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3604#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3605#[cfg_attr(feature = "serde", serde(tag = "type"))]
3606#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3607#[repr(u32)]
3608pub enum MavTunnelPayloadType {
3609 #[doc = "Encoding of payload unknown."]
3610 MAV_TUNNEL_PAYLOAD_TYPE_UNKNOWN = 0,
3611 #[doc = "Registered for STorM32 gimbal controller."]
3612 MAV_TUNNEL_PAYLOAD_TYPE_STORM32_RESERVED0 = 200,
3613 #[doc = "Registered for STorM32 gimbal controller."]
3614 MAV_TUNNEL_PAYLOAD_TYPE_STORM32_RESERVED1 = 201,
3615 #[doc = "Registered for STorM32 gimbal controller."]
3616 MAV_TUNNEL_PAYLOAD_TYPE_STORM32_RESERVED2 = 202,
3617 #[doc = "Registered for STorM32 gimbal controller."]
3618 MAV_TUNNEL_PAYLOAD_TYPE_STORM32_RESERVED3 = 203,
3619 #[doc = "Registered for STorM32 gimbal controller."]
3620 MAV_TUNNEL_PAYLOAD_TYPE_STORM32_RESERVED4 = 204,
3621 #[doc = "Registered for STorM32 gimbal controller."]
3622 MAV_TUNNEL_PAYLOAD_TYPE_STORM32_RESERVED5 = 205,
3623 #[doc = "Registered for STorM32 gimbal controller."]
3624 MAV_TUNNEL_PAYLOAD_TYPE_STORM32_RESERVED6 = 206,
3625 #[doc = "Registered for STorM32 gimbal controller."]
3626 MAV_TUNNEL_PAYLOAD_TYPE_STORM32_RESERVED7 = 207,
3627 #[doc = "Registered for STorM32 gimbal controller."]
3628 MAV_TUNNEL_PAYLOAD_TYPE_STORM32_RESERVED8 = 208,
3629 #[doc = "Registered for STorM32 gimbal controller."]
3630 MAV_TUNNEL_PAYLOAD_TYPE_STORM32_RESERVED9 = 209,
3631 #[doc = "Registered for ModalAI remote OSD protocol."]
3632 MAV_TUNNEL_PAYLOAD_TYPE_MODALAI_REMOTE_OSD = 210,
3633 #[doc = "Registered for ModalAI ESC UART passthru protocol."]
3634 MAV_TUNNEL_PAYLOAD_TYPE_MODALAI_ESC_UART_PASSTHRU = 211,
3635 #[doc = "Registered for ModalAI vendor use."]
3636 MAV_TUNNEL_PAYLOAD_TYPE_MODALAI_IO_UART_PASSTHRU = 212,
3637}
3638impl MavTunnelPayloadType {
3639 pub const DEFAULT: Self = Self::MAV_TUNNEL_PAYLOAD_TYPE_UNKNOWN;
3640}
3641impl Default for MavTunnelPayloadType {
3642 fn default() -> Self {
3643 Self::DEFAULT
3644 }
3645}
3646#[cfg_attr(feature = "ts", derive(TS))]
3647#[cfg_attr(feature = "ts", ts(export))]
3648#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3649#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3650#[cfg_attr(feature = "serde", serde(tag = "type"))]
3651#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3652#[repr(u32)]
3653#[doc = "MAVLINK component type reported in HEARTBEAT message. Flight controllers must report the type of the vehicle on which they are mounted (e.g. MAV_TYPE_OCTOROTOR). All other components must report a value appropriate for their type (e.g. a camera must use MAV_TYPE_CAMERA)."]
3654pub enum MavType {
3655 #[doc = "Generic micro air vehicle"]
3656 MAV_TYPE_GENERIC = 0,
3657 #[doc = "Fixed wing aircraft."]
3658 MAV_TYPE_FIXED_WING = 1,
3659 #[doc = "Quadrotor"]
3660 MAV_TYPE_QUADROTOR = 2,
3661 #[doc = "Coaxial helicopter"]
3662 MAV_TYPE_COAXIAL = 3,
3663 #[doc = "Normal helicopter with tail rotor."]
3664 MAV_TYPE_HELICOPTER = 4,
3665 #[doc = "Ground installation"]
3666 MAV_TYPE_ANTENNA_TRACKER = 5,
3667 #[doc = "Operator control unit / ground control station"]
3668 MAV_TYPE_GCS = 6,
3669 #[doc = "Airship, controlled"]
3670 MAV_TYPE_AIRSHIP = 7,
3671 #[doc = "Free balloon, uncontrolled"]
3672 MAV_TYPE_FREE_BALLOON = 8,
3673 #[doc = "Rocket"]
3674 MAV_TYPE_ROCKET = 9,
3675 #[doc = "Ground rover"]
3676 MAV_TYPE_GROUND_ROVER = 10,
3677 #[doc = "Surface vessel, boat, ship"]
3678 MAV_TYPE_SURFACE_BOAT = 11,
3679 #[doc = "Submarine"]
3680 MAV_TYPE_SUBMARINE = 12,
3681 #[doc = "Hexarotor"]
3682 MAV_TYPE_HEXAROTOR = 13,
3683 #[doc = "Octorotor"]
3684 MAV_TYPE_OCTOROTOR = 14,
3685 #[doc = "Tricopter"]
3686 MAV_TYPE_TRICOPTER = 15,
3687 #[doc = "Flapping wing"]
3688 MAV_TYPE_FLAPPING_WING = 16,
3689 #[doc = "Kite"]
3690 MAV_TYPE_KITE = 17,
3691 #[doc = "Onboard companion controller"]
3692 MAV_TYPE_ONBOARD_CONTROLLER = 18,
3693 #[doc = "Two-rotor Tailsitter VTOL that additionally uses control surfaces in vertical operation. Note, value previously named MAV_TYPE_VTOL_DUOROTOR."]
3694 MAV_TYPE_VTOL_TAILSITTER_DUOROTOR = 19,
3695 #[doc = "Quad-rotor Tailsitter VTOL using a V-shaped quad config in vertical operation. Note: value previously named MAV_TYPE_VTOL_QUADROTOR."]
3696 MAV_TYPE_VTOL_TAILSITTER_QUADROTOR = 20,
3697 #[doc = "Tiltrotor VTOL. Fuselage and wings stay (nominally) horizontal in all flight phases. It able to tilt (some) rotors to provide thrust in cruise flight."]
3698 MAV_TYPE_VTOL_TILTROTOR = 21,
3699 #[doc = "VTOL with separate fixed rotors for hover and cruise flight. Fuselage and wings stay (nominally) horizontal in all flight phases."]
3700 MAV_TYPE_VTOL_FIXEDROTOR = 22,
3701 #[doc = "Tailsitter VTOL. Fuselage and wings orientation changes depending on flight phase: vertical for hover, horizontal for cruise. Use more specific VTOL MAV_TYPE_VTOL_TAILSITTER_DUOROTOR or MAV_TYPE_VTOL_TAILSITTER_QUADROTOR if appropriate."]
3702 MAV_TYPE_VTOL_TAILSITTER = 23,
3703 #[doc = "Tiltwing VTOL. Fuselage stays horizontal in all flight phases. The whole wing, along with any attached engine, can tilt between vertical and horizontal mode."]
3704 MAV_TYPE_VTOL_TILTWING = 24,
3705 #[doc = "VTOL reserved 5"]
3706 MAV_TYPE_VTOL_RESERVED5 = 25,
3707 #[doc = "Gimbal"]
3708 MAV_TYPE_GIMBAL = 26,
3709 #[doc = "ADSB system"]
3710 MAV_TYPE_ADSB = 27,
3711 #[doc = "Steerable, nonrigid airfoil"]
3712 MAV_TYPE_PARAFOIL = 28,
3713 #[doc = "Dodecarotor"]
3714 MAV_TYPE_DODECAROTOR = 29,
3715 #[doc = "Camera"]
3716 MAV_TYPE_CAMERA = 30,
3717 #[doc = "Charging station"]
3718 MAV_TYPE_CHARGING_STATION = 31,
3719 #[doc = "FLARM collision avoidance system"]
3720 MAV_TYPE_FLARM = 32,
3721 #[doc = "Servo"]
3722 MAV_TYPE_SERVO = 33,
3723 #[doc = "Open Drone ID. See <https://mavlink.io/en/services/opendroneid.html>."]
3724 MAV_TYPE_ODID = 34,
3725 #[doc = "Decarotor"]
3726 MAV_TYPE_DECAROTOR = 35,
3727 #[doc = "Battery"]
3728 MAV_TYPE_BATTERY = 36,
3729 #[doc = "Parachute"]
3730 MAV_TYPE_PARACHUTE = 37,
3731 #[doc = "Log"]
3732 MAV_TYPE_LOG = 38,
3733 #[doc = "OSD"]
3734 MAV_TYPE_OSD = 39,
3735 #[doc = "IMU"]
3736 MAV_TYPE_IMU = 40,
3737 #[doc = "GPS"]
3738 MAV_TYPE_GPS = 41,
3739 #[doc = "Winch"]
3740 MAV_TYPE_WINCH = 42,
3741 #[doc = "Generic multirotor that does not fit into a specific type or whose type is unknown"]
3742 MAV_TYPE_GENERIC_MULTIROTOR = 43,
3743 #[doc = "Illuminator. An illuminator is a light source that is used for lighting up dark areas external to the sytstem: e.g. a torch or searchlight (as opposed to a light source for illuminating the system itself, e.g. an indicator light)."]
3744 MAV_TYPE_ILLUMINATOR = 44,
3745 #[doc = "Orbiter spacecraft. Includes satellites orbiting terrestrial and extra-terrestrial bodies. Follows NASA Spacecraft Classification."]
3746 MAV_TYPE_SPACECRAFT_ORBITER = 45,
3747}
3748impl MavType {
3749 pub const DEFAULT: Self = Self::MAV_TYPE_GENERIC;
3750}
3751impl Default for MavType {
3752 fn default() -> Self {
3753 Self::DEFAULT
3754 }
3755}
3756#[cfg_attr(feature = "ts", derive(TS))]
3757#[cfg_attr(feature = "ts", ts(export))]
3758#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3759#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3760#[cfg_attr(feature = "serde", serde(tag = "type"))]
3761#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3762#[repr(u32)]
3763#[doc = "Enumeration of VTOL states"]
3764pub enum MavVtolState {
3765 #[doc = "MAV is not configured as VTOL"]
3766 MAV_VTOL_STATE_UNDEFINED = 0,
3767 #[doc = "VTOL is in transition from multicopter to fixed-wing"]
3768 MAV_VTOL_STATE_TRANSITION_TO_FW = 1,
3769 #[doc = "VTOL is in transition from fixed-wing to multicopter"]
3770 MAV_VTOL_STATE_TRANSITION_TO_MC = 2,
3771 #[doc = "VTOL is in multicopter state"]
3772 MAV_VTOL_STATE_MC = 3,
3773 #[doc = "VTOL is in fixed-wing state"]
3774 MAV_VTOL_STATE_FW = 4,
3775}
3776impl MavVtolState {
3777 pub const DEFAULT: Self = Self::MAV_VTOL_STATE_UNDEFINED;
3778}
3779impl Default for MavVtolState {
3780 fn default() -> Self {
3781 Self::DEFAULT
3782 }
3783}
3784bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Winch status flags used in WINCH_STATUS"] pub struct MavWinchStatusFlag : u32 { # [doc = "Winch is healthy"] const MAV_WINCH_STATUS_HEALTHY = 1 ; # [doc = "Winch line is fully retracted"] const MAV_WINCH_STATUS_FULLY_RETRACTED = 2 ; # [doc = "Winch motor is moving"] const MAV_WINCH_STATUS_MOVING = 4 ; # [doc = "Winch clutch is engaged allowing motor to move freely."] const MAV_WINCH_STATUS_CLUTCH_ENGAGED = 8 ; # [doc = "Winch is locked by locking mechanism."] const MAV_WINCH_STATUS_LOCKED = 16 ; # [doc = "Winch is gravity dropping payload."] const MAV_WINCH_STATUS_DROPPING = 32 ; # [doc = "Winch is arresting payload descent."] const MAV_WINCH_STATUS_ARRESTING = 64 ; # [doc = "Winch is using torque measurements to sense the ground."] const MAV_WINCH_STATUS_GROUND_SENSE = 128 ; # [doc = "Winch is returning to the fully retracted position."] const MAV_WINCH_STATUS_RETRACTING = 256 ; # [doc = "Winch is redelivering the payload. This is a failover state if the line tension goes above a threshold during RETRACTING."] const MAV_WINCH_STATUS_REDELIVER = 512 ; # [doc = "Winch is abandoning the line and possibly payload. Winch unspools the entire calculated line length. This is a failover state from REDELIVER if the number of attempts exceeds a threshold."] const MAV_WINCH_STATUS_ABANDON_LINE = 1024 ; # [doc = "Winch is engaging the locking mechanism."] const MAV_WINCH_STATUS_LOCKING = 2048 ; # [doc = "Winch is spooling on line."] const MAV_WINCH_STATUS_LOAD_LINE = 4096 ; # [doc = "Winch is loading a payload."] const MAV_WINCH_STATUS_LOAD_PAYLOAD = 8192 ; } }
3785impl MavWinchStatusFlag {
3786 pub const DEFAULT: Self = Self::MAV_WINCH_STATUS_HEALTHY;
3787}
3788impl Default for MavWinchStatusFlag {
3789 fn default() -> Self {
3790 Self::DEFAULT
3791 }
3792}
3793#[cfg_attr(feature = "ts", derive(TS))]
3794#[cfg_attr(feature = "ts", ts(export))]
3795#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3796#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3797#[cfg_attr(feature = "serde", serde(tag = "type"))]
3798#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3799#[repr(u32)]
3800pub enum MavlinkDataStreamType {
3801 MAVLINK_DATA_STREAM_IMG_JPEG = 0,
3802 MAVLINK_DATA_STREAM_IMG_BMP = 1,
3803 MAVLINK_DATA_STREAM_IMG_RAW8U = 2,
3804 MAVLINK_DATA_STREAM_IMG_RAW32U = 3,
3805 MAVLINK_DATA_STREAM_IMG_PGM = 4,
3806 MAVLINK_DATA_STREAM_IMG_PNG = 5,
3807}
3808impl MavlinkDataStreamType {
3809 pub const DEFAULT: Self = Self::MAVLINK_DATA_STREAM_IMG_JPEG;
3810}
3811impl Default for MavlinkDataStreamType {
3812 fn default() -> Self {
3813 Self::DEFAULT
3814 }
3815}
3816#[cfg_attr(feature = "ts", derive(TS))]
3817#[cfg_attr(feature = "ts", ts(export))]
3818#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3819#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3820#[cfg_attr(feature = "serde", serde(tag = "type"))]
3821#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3822#[repr(u32)]
3823#[doc = "States of the mission state machine. Note that these states are independent of whether the mission is in a mode that can execute mission items or not (is suspended). They may not all be relevant on all vehicles."]
3824pub enum MissionState {
3825 #[doc = "The mission status reporting is not supported."]
3826 MISSION_STATE_UNKNOWN = 0,
3827 #[doc = "No mission on the vehicle."]
3828 MISSION_STATE_NO_MISSION = 1,
3829 #[doc = "Mission has not started. This is the case after a mission has uploaded but not yet started executing."]
3830 MISSION_STATE_NOT_STARTED = 2,
3831 #[doc = "Mission is active, and will execute mission items when in auto mode."]
3832 MISSION_STATE_ACTIVE = 3,
3833 #[doc = "Mission is paused when in auto mode."]
3834 MISSION_STATE_PAUSED = 4,
3835 #[doc = "Mission has executed all mission items."]
3836 MISSION_STATE_COMPLETE = 5,
3837}
3838impl MissionState {
3839 pub const DEFAULT: Self = Self::MISSION_STATE_UNKNOWN;
3840}
3841impl Default for MissionState {
3842 fn default() -> Self {
3843 Self::DEFAULT
3844 }
3845}
3846#[cfg_attr(feature = "ts", derive(TS))]
3847#[cfg_attr(feature = "ts", ts(export))]
3848#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3849#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3850#[cfg_attr(feature = "serde", serde(tag = "type"))]
3851#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3852#[repr(u32)]
3853#[doc = "Sequence that motors are tested when using MAV_CMD_DO_MOTOR_TEST."]
3854pub enum MotorTestOrder {
3855 #[doc = "Default autopilot motor test method."]
3856 MOTOR_TEST_ORDER_DEFAULT = 0,
3857 #[doc = "Motor numbers are specified as their index in a predefined vehicle-specific sequence."]
3858 MOTOR_TEST_ORDER_SEQUENCE = 1,
3859 #[doc = "Motor numbers are specified as the output as labeled on the board."]
3860 MOTOR_TEST_ORDER_BOARD = 2,
3861}
3862impl MotorTestOrder {
3863 pub const DEFAULT: Self = Self::MOTOR_TEST_ORDER_DEFAULT;
3864}
3865impl Default for MotorTestOrder {
3866 fn default() -> Self {
3867 Self::DEFAULT
3868 }
3869}
3870#[cfg_attr(feature = "ts", derive(TS))]
3871#[cfg_attr(feature = "ts", ts(export))]
3872#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3873#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3874#[cfg_attr(feature = "serde", serde(tag = "type"))]
3875#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3876#[repr(u32)]
3877#[doc = "Defines how throttle value is represented in MAV_CMD_DO_MOTOR_TEST."]
3878pub enum MotorTestThrottleType {
3879 #[doc = "Throttle as a percentage (0 ~ 100)"]
3880 MOTOR_TEST_THROTTLE_PERCENT = 0,
3881 #[doc = "Throttle as an absolute PWM value (normally in range of 1000~2000)."]
3882 MOTOR_TEST_THROTTLE_PWM = 1,
3883 #[doc = "Throttle pass-through from pilot's transmitter."]
3884 MOTOR_TEST_THROTTLE_PILOT = 2,
3885 #[doc = "Per-motor compass calibration test."]
3886 MOTOR_TEST_COMPASS_CAL = 3,
3887}
3888impl MotorTestThrottleType {
3889 pub const DEFAULT: Self = Self::MOTOR_TEST_THROTTLE_PERCENT;
3890}
3891impl Default for MotorTestThrottleType {
3892 fn default() -> Self {
3893 Self::DEFAULT
3894 }
3895}
3896#[cfg_attr(feature = "ts", derive(TS))]
3897#[cfg_attr(feature = "ts", ts(export))]
3898#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3899#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3900#[cfg_attr(feature = "serde", serde(tag = "type"))]
3901#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3902#[repr(u32)]
3903pub enum NavVtolLandOptions {
3904 #[doc = "Default autopilot landing behaviour."]
3905 NAV_VTOL_LAND_OPTIONS_DEFAULT = 0,
3906 #[doc = "Descend in fixed wing mode, transitioning to multicopter mode for vertical landing when close to the ground. The fixed wing descent pattern is at the discretion of the vehicle (e.g. transition altitude, loiter direction, radius, and speed, etc.)."]
3907 NAV_VTOL_LAND_OPTIONS_FW_DESCENT = 1,
3908 #[doc = "Land in multicopter mode on reaching the landing coordinates (the whole landing is by \"hover descent\")."]
3909 NAV_VTOL_LAND_OPTIONS_HOVER_DESCENT = 2,
3910}
3911impl NavVtolLandOptions {
3912 pub const DEFAULT: Self = Self::NAV_VTOL_LAND_OPTIONS_DEFAULT;
3913}
3914impl Default for NavVtolLandOptions {
3915 fn default() -> Self {
3916 Self::DEFAULT
3917 }
3918}
3919#[cfg_attr(feature = "ts", derive(TS))]
3920#[cfg_attr(feature = "ts", ts(export))]
3921#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3922#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3923#[cfg_attr(feature = "serde", serde(tag = "type"))]
3924#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3925#[repr(u32)]
3926#[doc = "Yaw behaviour during orbit flight."]
3927pub enum OrbitYawBehaviour {
3928 #[doc = "Vehicle front points to the center (default)."]
3929 ORBIT_YAW_BEHAVIOUR_HOLD_FRONT_TO_CIRCLE_CENTER = 0,
3930 #[doc = "Vehicle front holds heading when message received."]
3931 ORBIT_YAW_BEHAVIOUR_HOLD_INITIAL_HEADING = 1,
3932 #[doc = "Yaw uncontrolled."]
3933 ORBIT_YAW_BEHAVIOUR_UNCONTROLLED = 2,
3934 #[doc = "Vehicle front follows flight path (tangential to circle)."]
3935 ORBIT_YAW_BEHAVIOUR_HOLD_FRONT_TANGENT_TO_CIRCLE = 3,
3936 #[doc = "Yaw controlled by RC input."]
3937 ORBIT_YAW_BEHAVIOUR_RC_CONTROLLED = 4,
3938 #[doc = "Vehicle uses current yaw behaviour (unchanged). The vehicle-default yaw behaviour is used if this value is specified when orbit is first commanded."]
3939 ORBIT_YAW_BEHAVIOUR_UNCHANGED = 5,
3940}
3941impl OrbitYawBehaviour {
3942 pub const DEFAULT: Self = Self::ORBIT_YAW_BEHAVIOUR_HOLD_FRONT_TO_CIRCLE_CENTER;
3943}
3944impl Default for OrbitYawBehaviour {
3945 fn default() -> Self {
3946 Self::DEFAULT
3947 }
3948}
3949#[cfg_attr(feature = "ts", derive(TS))]
3950#[cfg_attr(feature = "ts", ts(export))]
3951#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3952#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3953#[cfg_attr(feature = "serde", serde(tag = "type"))]
3954#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3955#[repr(u32)]
3956#[doc = "Parachute actions. Trigger release and enable/disable auto-release."]
3957pub enum ParachuteAction {
3958 #[doc = "Disable auto-release of parachute (i.e. release triggered by crash detectors)."]
3959 PARACHUTE_DISABLE = 0,
3960 #[doc = "Enable auto-release of parachute."]
3961 PARACHUTE_ENABLE = 1,
3962 #[doc = "Release parachute and kill motors."]
3963 PARACHUTE_RELEASE = 2,
3964}
3965impl ParachuteAction {
3966 pub const DEFAULT: Self = Self::PARACHUTE_DISABLE;
3967}
3968impl Default for ParachuteAction {
3969 fn default() -> Self {
3970 Self::DEFAULT
3971 }
3972}
3973#[cfg_attr(feature = "ts", derive(TS))]
3974#[cfg_attr(feature = "ts", ts(export))]
3975#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3976#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3977#[cfg_attr(feature = "serde", serde(tag = "type"))]
3978#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3979#[repr(u32)]
3980#[doc = "Result from PARAM_EXT_SET message."]
3981pub enum ParamAck {
3982 #[doc = "Parameter value ACCEPTED and SET"]
3983 PARAM_ACK_ACCEPTED = 0,
3984 #[doc = "Parameter value UNKNOWN/UNSUPPORTED"]
3985 PARAM_ACK_VALUE_UNSUPPORTED = 1,
3986 #[doc = "Parameter failed to set"]
3987 PARAM_ACK_FAILED = 2,
3988 #[doc = "Parameter value received but not yet set/accepted. A subsequent PARAM_EXT_ACK with the final result will follow once operation is completed. This is returned immediately for parameters that take longer to set, indicating that the the parameter was received and does not need to be resent."]
3989 PARAM_ACK_IN_PROGRESS = 3,
3990}
3991impl ParamAck {
3992 pub const DEFAULT: Self = Self::PARAM_ACK_ACCEPTED;
3993}
3994impl Default for ParamAck {
3995 fn default() -> Self {
3996 Self::DEFAULT
3997 }
3998}
3999bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Bitmap to indicate which dimensions should be ignored by the vehicle: a value of 0b0000000000000000 or 0b0000001000000000 indicates that none of the setpoint dimensions should be ignored. If bit 9 is set the floats afx afy afz should be interpreted as force instead of acceleration."] pub struct PositionTargetTypemask : u16 { # [doc = "Ignore position x"] const POSITION_TARGET_TYPEMASK_X_IGNORE = 1 ; # [doc = "Ignore position y"] const POSITION_TARGET_TYPEMASK_Y_IGNORE = 2 ; # [doc = "Ignore position z"] const POSITION_TARGET_TYPEMASK_Z_IGNORE = 4 ; # [doc = "Ignore velocity x"] const POSITION_TARGET_TYPEMASK_VX_IGNORE = 8 ; # [doc = "Ignore velocity y"] const POSITION_TARGET_TYPEMASK_VY_IGNORE = 16 ; # [doc = "Ignore velocity z"] const POSITION_TARGET_TYPEMASK_VZ_IGNORE = 32 ; # [doc = "Ignore acceleration x"] const POSITION_TARGET_TYPEMASK_AX_IGNORE = 64 ; # [doc = "Ignore acceleration y"] const POSITION_TARGET_TYPEMASK_AY_IGNORE = 128 ; # [doc = "Ignore acceleration z"] const POSITION_TARGET_TYPEMASK_AZ_IGNORE = 256 ; # [doc = "Use force instead of acceleration"] const POSITION_TARGET_TYPEMASK_FORCE_SET = 512 ; # [doc = "Ignore yaw"] const POSITION_TARGET_TYPEMASK_YAW_IGNORE = 1024 ; # [doc = "Ignore yaw rate"] const POSITION_TARGET_TYPEMASK_YAW_RATE_IGNORE = 2048 ; } }
4000impl PositionTargetTypemask {
4001 pub const DEFAULT: Self = Self::POSITION_TARGET_TYPEMASK_X_IGNORE;
4002}
4003impl Default for PositionTargetTypemask {
4004 fn default() -> Self {
4005 Self::DEFAULT
4006 }
4007}
4008#[cfg_attr(feature = "ts", derive(TS))]
4009#[cfg_attr(feature = "ts", ts(export))]
4010#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4011#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4012#[cfg_attr(feature = "serde", serde(tag = "type"))]
4013#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4014#[repr(u32)]
4015#[doc = "Precision land modes (used in MAV_CMD_NAV_LAND)."]
4016pub enum PrecisionLandMode {
4017 #[doc = "Normal (non-precision) landing."]
4018 PRECISION_LAND_MODE_DISABLED = 0,
4019 #[doc = "Use precision landing if beacon detected when land command accepted, otherwise land normally."]
4020 PRECISION_LAND_MODE_OPPORTUNISTIC = 1,
4021 #[doc = "Use precision landing, searching for beacon if not found when land command accepted (land normally if beacon cannot be found)."]
4022 PRECISION_LAND_MODE_REQUIRED = 2,
4023}
4024impl PrecisionLandMode {
4025 pub const DEFAULT: Self = Self::PRECISION_LAND_MODE_DISABLED;
4026}
4027impl Default for PrecisionLandMode {
4028 fn default() -> Self {
4029 Self::DEFAULT
4030 }
4031}
4032#[cfg_attr(feature = "ts", derive(TS))]
4033#[cfg_attr(feature = "ts", ts(export))]
4034#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4035#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4036#[cfg_attr(feature = "serde", serde(tag = "type"))]
4037#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4038#[repr(u32)]
4039#[doc = "Actions for reading and writing plan information (mission, rally points, geofence) between persistent and volatile storage when using MAV_CMD_PREFLIGHT_STORAGE. (Commonly missions are loaded from persistent storage (flash/EEPROM) into volatile storage (RAM) on startup and written back when they are changed.)"]
4040pub enum PreflightStorageMissionAction {
4041 #[doc = "Read current mission data from persistent storage"]
4042 MISSION_READ_PERSISTENT = 0,
4043 #[doc = "Write current mission data to persistent storage"]
4044 MISSION_WRITE_PERSISTENT = 1,
4045 #[doc = "Erase all mission data stored on the vehicle (both persistent and volatile storage)"]
4046 MISSION_RESET_DEFAULT = 2,
4047}
4048impl PreflightStorageMissionAction {
4049 pub const DEFAULT: Self = Self::MISSION_READ_PERSISTENT;
4050}
4051impl Default for PreflightStorageMissionAction {
4052 fn default() -> Self {
4053 Self::DEFAULT
4054 }
4055}
4056#[cfg_attr(feature = "ts", derive(TS))]
4057#[cfg_attr(feature = "ts", ts(export))]
4058#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4059#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4060#[cfg_attr(feature = "serde", serde(tag = "type"))]
4061#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4062#[repr(u32)]
4063#[doc = "Actions for reading/writing parameters between persistent and volatile storage when using MAV_CMD_PREFLIGHT_STORAGE. (Commonly parameters are loaded from persistent storage (flash/EEPROM) into volatile storage (RAM) on startup and written back when they are changed.)"]
4064pub enum PreflightStorageParameterAction {
4065 #[doc = "Read all parameters from persistent storage. Replaces values in volatile storage."]
4066 PARAM_READ_PERSISTENT = 0,
4067 #[doc = "Write all parameter values to persistent storage (flash/EEPROM)"]
4068 PARAM_WRITE_PERSISTENT = 1,
4069 #[doc = "Reset all user configurable parameters to their default value (including airframe selection, sensor calibration data, safety settings, and so on). Does not reset values that contain operation counters and vehicle computed statistics."]
4070 PARAM_RESET_CONFIG_DEFAULT = 2,
4071 #[doc = "Reset only sensor calibration parameters to factory defaults (or firmware default if not available)"]
4072 PARAM_RESET_SENSOR_DEFAULT = 3,
4073 #[doc = "Reset all parameters, including operation counters, to default values"]
4074 PARAM_RESET_ALL_DEFAULT = 4,
4075}
4076impl PreflightStorageParameterAction {
4077 pub const DEFAULT: Self = Self::PARAM_READ_PERSISTENT;
4078}
4079impl Default for PreflightStorageParameterAction {
4080 fn default() -> Self {
4081 Self::DEFAULT
4082 }
4083}
4084#[cfg_attr(feature = "ts", derive(TS))]
4085#[cfg_attr(feature = "ts", ts(export))]
4086#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4087#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4088#[cfg_attr(feature = "serde", serde(tag = "type"))]
4089#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4090#[repr(u32)]
4091#[doc = "RC sub-type of types defined in RC_TYPE. Used in MAV_CMD_START_RX_PAIR. Ignored if value does not correspond to the set RC_TYPE."]
4092pub enum RcSubType {
4093 #[doc = "Spektrum DSM2"]
4094 RC_SUB_TYPE_SPEKTRUM_DSM2 = 0,
4095 #[doc = "Spektrum DSMX"]
4096 RC_SUB_TYPE_SPEKTRUM_DSMX = 1,
4097 #[doc = "Spektrum DSMX8"]
4098 RC_SUB_TYPE_SPEKTRUM_DSMX8 = 2,
4099}
4100impl RcSubType {
4101 pub const DEFAULT: Self = Self::RC_SUB_TYPE_SPEKTRUM_DSM2;
4102}
4103impl Default for RcSubType {
4104 fn default() -> Self {
4105 Self::DEFAULT
4106 }
4107}
4108#[cfg_attr(feature = "ts", derive(TS))]
4109#[cfg_attr(feature = "ts", ts(export))]
4110#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4111#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4112#[cfg_attr(feature = "serde", serde(tag = "type"))]
4113#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4114#[repr(u32)]
4115#[doc = "RC type. Used in MAV_CMD_START_RX_PAIR."]
4116pub enum RcType {
4117 #[doc = "Spektrum"]
4118 RC_TYPE_SPEKTRUM = 0,
4119 #[doc = "CRSF"]
4120 RC_TYPE_CRSF = 1,
4121}
4122impl RcType {
4123 pub const DEFAULT: Self = Self::RC_TYPE_SPEKTRUM;
4124}
4125impl Default for RcType {
4126 fn default() -> Self {
4127 Self::DEFAULT
4128 }
4129}
4130#[cfg_attr(feature = "ts", derive(TS))]
4131#[cfg_attr(feature = "ts", ts(export))]
4132#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4133#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4134#[cfg_attr(feature = "serde", serde(tag = "type"))]
4135#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4136#[repr(u32)]
4137#[doc = "Specifies the conditions under which the MAV_CMD_PREFLIGHT_REBOOT_SHUTDOWN command should be accepted."]
4138pub enum RebootShutdownConditions {
4139 #[doc = "Reboot/Shutdown only if allowed by safety checks, such as being landed."]
4140 REBOOT_SHUTDOWN_CONDITIONS_SAFETY_INTERLOCKED = 0,
4141 #[doc = "Force reboot/shutdown of the autopilot/component regardless of system state."]
4142 REBOOT_SHUTDOWN_CONDITIONS_FORCE = 20190226,
4143}
4144impl RebootShutdownConditions {
4145 pub const DEFAULT: Self = Self::REBOOT_SHUTDOWN_CONDITIONS_SAFETY_INTERLOCKED;
4146}
4147impl Default for RebootShutdownConditions {
4148 fn default() -> Self {
4149 Self::DEFAULT
4150 }
4151}
4152#[cfg_attr(feature = "ts", derive(TS))]
4153#[cfg_attr(feature = "ts", ts(export))]
4154#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4155#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4156#[cfg_attr(feature = "serde", serde(tag = "type"))]
4157#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4158#[repr(u32)]
4159#[doc = "RTK GPS baseline coordinate system, used for RTK corrections"]
4160pub enum RtkBaselineCoordinateSystem {
4161 #[doc = "Earth-centered, Earth-fixed"]
4162 RTK_BASELINE_COORDINATE_SYSTEM_ECEF = 0,
4163 #[doc = "RTK basestation centered, north, east, down"]
4164 RTK_BASELINE_COORDINATE_SYSTEM_NED = 1,
4165}
4166impl RtkBaselineCoordinateSystem {
4167 pub const DEFAULT: Self = Self::RTK_BASELINE_COORDINATE_SYSTEM_ECEF;
4168}
4169impl Default for RtkBaselineCoordinateSystem {
4170 fn default() -> Self {
4171 Self::DEFAULT
4172 }
4173}
4174#[cfg_attr(feature = "ts", derive(TS))]
4175#[cfg_attr(feature = "ts", ts(export))]
4176#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4177#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4178#[cfg_attr(feature = "serde", serde(tag = "type"))]
4179#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4180#[repr(u32)]
4181#[doc = "Possible safety switch states."]
4182pub enum SafetySwitchState {
4183 #[doc = "Safety switch is engaged and vehicle should be safe to approach."]
4184 SAFETY_SWITCH_STATE_SAFE = 0,
4185 #[doc = "Safety switch is NOT engaged and motors, propellers and other actuators should be considered active."]
4186 SAFETY_SWITCH_STATE_DANGEROUS = 1,
4187}
4188impl SafetySwitchState {
4189 pub const DEFAULT: Self = Self::SAFETY_SWITCH_STATE_SAFE;
4190}
4191impl Default for SafetySwitchState {
4192 fn default() -> Self {
4193 Self::DEFAULT
4194 }
4195}
4196#[cfg_attr(feature = "ts", derive(TS))]
4197#[cfg_attr(feature = "ts", ts(export))]
4198#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4199#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4200#[cfg_attr(feature = "serde", serde(tag = "type"))]
4201#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4202#[repr(u32)]
4203#[doc = "SERIAL_CONTROL device types"]
4204pub enum SerialControlDev {
4205 #[doc = "First telemetry port"]
4206 SERIAL_CONTROL_DEV_TELEM1 = 0,
4207 #[doc = "Second telemetry port"]
4208 SERIAL_CONTROL_DEV_TELEM2 = 1,
4209 #[doc = "First GPS port"]
4210 SERIAL_CONTROL_DEV_GPS1 = 2,
4211 #[doc = "Second GPS port"]
4212 SERIAL_CONTROL_DEV_GPS2 = 3,
4213 #[doc = "system shell"]
4214 SERIAL_CONTROL_DEV_SHELL = 10,
4215 #[doc = "SERIAL0"]
4216 SERIAL_CONTROL_SERIAL0 = 100,
4217 #[doc = "SERIAL1"]
4218 SERIAL_CONTROL_SERIAL1 = 101,
4219 #[doc = "SERIAL2"]
4220 SERIAL_CONTROL_SERIAL2 = 102,
4221 #[doc = "SERIAL3"]
4222 SERIAL_CONTROL_SERIAL3 = 103,
4223 #[doc = "SERIAL4"]
4224 SERIAL_CONTROL_SERIAL4 = 104,
4225 #[doc = "SERIAL5"]
4226 SERIAL_CONTROL_SERIAL5 = 105,
4227 #[doc = "SERIAL6"]
4228 SERIAL_CONTROL_SERIAL6 = 106,
4229 #[doc = "SERIAL7"]
4230 SERIAL_CONTROL_SERIAL7 = 107,
4231 #[doc = "SERIAL8"]
4232 SERIAL_CONTROL_SERIAL8 = 108,
4233 #[doc = "SERIAL9"]
4234 SERIAL_CONTROL_SERIAL9 = 109,
4235}
4236impl SerialControlDev {
4237 pub const DEFAULT: Self = Self::SERIAL_CONTROL_DEV_TELEM1;
4238}
4239impl Default for SerialControlDev {
4240 fn default() -> Self {
4241 Self::DEFAULT
4242 }
4243}
4244bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "SERIAL_CONTROL flags (bitmask)"] pub struct SerialControlFlag : u8 { # [doc = "Set if this is a reply"] const SERIAL_CONTROL_FLAG_REPLY = 1 ; # [doc = "Set if the sender wants the receiver to send a response as another SERIAL_CONTROL message"] const SERIAL_CONTROL_FLAG_RESPOND = 2 ; # [doc = "Set if access to the serial port should be removed from whatever driver is currently using it, giving exclusive access to the SERIAL_CONTROL protocol. The port can be handed back by sending a request without this flag set"] const SERIAL_CONTROL_FLAG_EXCLUSIVE = 4 ; # [doc = "Block on writes to the serial port"] const SERIAL_CONTROL_FLAG_BLOCKING = 8 ; # [doc = "Send multiple replies until port is drained"] const SERIAL_CONTROL_FLAG_MULTI = 16 ; } }
4245impl SerialControlFlag {
4246 pub const DEFAULT: Self = Self::SERIAL_CONTROL_FLAG_REPLY;
4247}
4248impl Default for SerialControlFlag {
4249 fn default() -> Self {
4250 Self::DEFAULT
4251 }
4252}
4253#[cfg_attr(feature = "ts", derive(TS))]
4254#[cfg_attr(feature = "ts", ts(export))]
4255#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4256#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4257#[cfg_attr(feature = "serde", serde(tag = "type"))]
4258#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4259#[repr(u32)]
4260#[doc = "Focus types for MAV_CMD_SET_CAMERA_FOCUS"]
4261pub enum SetFocusType {
4262 #[doc = "Focus one step increment (-1 for focusing in, 1 for focusing out towards infinity)."]
4263 FOCUS_TYPE_STEP = 0,
4264 #[doc = "Continuous normalized focus in/out rate until stopped. Range -1..1, negative: in, positive: out towards infinity, 0 to stop focusing. Other values should be clipped to the range."]
4265 FOCUS_TYPE_CONTINUOUS = 1,
4266 #[doc = "Focus value as proportion of full camera focus range (a value between 0.0 and 100.0)"]
4267 FOCUS_TYPE_RANGE = 2,
4268 #[doc = "Focus value in metres. Note that there is no message to get the valid focus range of the camera, so this can type can only be used for cameras where the range is known (implying that this cannot reliably be used in a GCS for an arbitrary camera)."]
4269 FOCUS_TYPE_METERS = 3,
4270 #[doc = "Focus automatically."]
4271 FOCUS_TYPE_AUTO = 4,
4272 #[doc = "Single auto focus. Mainly used for still pictures. Usually abbreviated as AF-S."]
4273 FOCUS_TYPE_AUTO_SINGLE = 5,
4274 #[doc = "Continuous auto focus. Mainly used for dynamic scenes. Abbreviated as AF-C."]
4275 FOCUS_TYPE_AUTO_CONTINUOUS = 6,
4276}
4277impl SetFocusType {
4278 pub const DEFAULT: Self = Self::FOCUS_TYPE_STEP;
4279}
4280impl Default for SetFocusType {
4281 fn default() -> Self {
4282 Self::DEFAULT
4283 }
4284}
4285#[cfg_attr(feature = "ts", derive(TS))]
4286#[cfg_attr(feature = "ts", ts(export))]
4287#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4288#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4289#[cfg_attr(feature = "serde", serde(tag = "type"))]
4290#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4291#[repr(u32)]
4292#[doc = "Speed setpoint types used in MAV_CMD_DO_CHANGE_SPEED"]
4293pub enum SpeedType {
4294 #[doc = "Airspeed"]
4295 SPEED_TYPE_AIRSPEED = 0,
4296 #[doc = "Groundspeed"]
4297 SPEED_TYPE_GROUNDSPEED = 1,
4298 #[doc = "Climb speed"]
4299 SPEED_TYPE_CLIMB_SPEED = 2,
4300 #[doc = "Descent speed"]
4301 SPEED_TYPE_DESCENT_SPEED = 3,
4302}
4303impl SpeedType {
4304 pub const DEFAULT: Self = Self::SPEED_TYPE_AIRSPEED;
4305}
4306impl Default for SpeedType {
4307 fn default() -> Self {
4308 Self::DEFAULT
4309 }
4310}
4311#[cfg_attr(feature = "ts", derive(TS))]
4312#[cfg_attr(feature = "ts", ts(export))]
4313#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4314#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4315#[cfg_attr(feature = "serde", serde(tag = "type"))]
4316#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4317#[repr(u32)]
4318#[doc = "Flags to indicate the status of camera storage."]
4319pub enum StorageStatus {
4320 #[doc = "Storage is missing (no microSD card loaded for example.)"]
4321 STORAGE_STATUS_EMPTY = 0,
4322 #[doc = "Storage present but unformatted."]
4323 STORAGE_STATUS_UNFORMATTED = 1,
4324 #[doc = "Storage present and ready."]
4325 STORAGE_STATUS_READY = 2,
4326 #[doc = "Camera does not supply storage status information. Capacity information in STORAGE_INFORMATION fields will be ignored."]
4327 STORAGE_STATUS_NOT_SUPPORTED = 3,
4328}
4329impl StorageStatus {
4330 pub const DEFAULT: Self = Self::STORAGE_STATUS_EMPTY;
4331}
4332impl Default for StorageStatus {
4333 fn default() -> Self {
4334 Self::DEFAULT
4335 }
4336}
4337#[cfg_attr(feature = "ts", derive(TS))]
4338#[cfg_attr(feature = "ts", ts(export))]
4339#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4340#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4341#[cfg_attr(feature = "serde", serde(tag = "type"))]
4342#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4343#[repr(u32)]
4344#[doc = "Flags to indicate the type of storage."]
4345pub enum StorageType {
4346 #[doc = "Storage type is not known."]
4347 STORAGE_TYPE_UNKNOWN = 0,
4348 #[doc = "Storage type is USB device."]
4349 STORAGE_TYPE_USB_STICK = 1,
4350 #[doc = "Storage type is SD card."]
4351 STORAGE_TYPE_SD = 2,
4352 #[doc = "Storage type is microSD card."]
4353 STORAGE_TYPE_MICROSD = 3,
4354 #[doc = "Storage type is CFast."]
4355 STORAGE_TYPE_CF = 4,
4356 #[doc = "Storage type is CFexpress."]
4357 STORAGE_TYPE_CFE = 5,
4358 #[doc = "Storage type is XQD."]
4359 STORAGE_TYPE_XQD = 6,
4360 #[doc = "Storage type is HD mass storage type."]
4361 STORAGE_TYPE_HD = 7,
4362 #[doc = "Storage type is other, not listed type."]
4363 STORAGE_TYPE_OTHER = 254,
4364}
4365impl StorageType {
4366 pub const DEFAULT: Self = Self::STORAGE_TYPE_UNKNOWN;
4367}
4368impl Default for StorageType {
4369 fn default() -> Self {
4370 Self::DEFAULT
4371 }
4372}
4373bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Flags to indicate usage for a particular storage (see STORAGE_INFORMATION.storage_usage and MAV_CMD_SET_STORAGE_USAGE)."] pub struct StorageUsageFlag : u8 { # [doc = "Always set to 1 (indicates STORAGE_INFORMATION.storage_usage is supported)."] const STORAGE_USAGE_FLAG_SET = 1 ; # [doc = "Storage for saving photos."] const STORAGE_USAGE_FLAG_PHOTO = 2 ; # [doc = "Storage for saving videos."] const STORAGE_USAGE_FLAG_VIDEO = 4 ; # [doc = "Storage for saving logs."] const STORAGE_USAGE_FLAG_LOGS = 8 ; } }
4374impl StorageUsageFlag {
4375 pub const DEFAULT: Self = Self::STORAGE_USAGE_FLAG_SET;
4376}
4377impl Default for StorageUsageFlag {
4378 fn default() -> Self {
4379 Self::DEFAULT
4380 }
4381}
4382#[cfg_attr(feature = "ts", derive(TS))]
4383#[cfg_attr(feature = "ts", ts(export))]
4384#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4385#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4386#[cfg_attr(feature = "serde", serde(tag = "type"))]
4387#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4388#[repr(u32)]
4389#[doc = "Tune formats (used for vehicle buzzer/tone generation)."]
4390pub enum TuneFormat {
4391 #[doc = "Format is QBasic 1.1 Play: <https://www.qbasic.net/en/reference/qb11/Statement/PLAY-006.htm>."]
4392 TUNE_FORMAT_QBASIC1_1 = 1,
4393 #[doc = "Format is Modern Music Markup Language (MML): <https://en.wikipedia.org/wiki/Music_Macro_Language#Modern_MML>."]
4394 TUNE_FORMAT_MML_MODERN = 2,
4395}
4396impl TuneFormat {
4397 pub const DEFAULT: Self = Self::TUNE_FORMAT_QBASIC1_1;
4398}
4399impl Default for TuneFormat {
4400 fn default() -> Self {
4401 Self::DEFAULT
4402 }
4403}
4404#[cfg_attr(feature = "ts", derive(TS))]
4405#[cfg_attr(feature = "ts", ts(export))]
4406#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4407#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4408#[cfg_attr(feature = "serde", serde(tag = "type"))]
4409#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4410#[repr(u32)]
4411#[doc = "Generalized UAVCAN node health"]
4412pub enum UavcanNodeHealth {
4413 #[doc = "The node is functioning properly."]
4414 UAVCAN_NODE_HEALTH_OK = 0,
4415 #[doc = "A critical parameter went out of range or the node has encountered a minor failure."]
4416 UAVCAN_NODE_HEALTH_WARNING = 1,
4417 #[doc = "The node has encountered a major failure."]
4418 UAVCAN_NODE_HEALTH_ERROR = 2,
4419 #[doc = "The node has suffered a fatal malfunction."]
4420 UAVCAN_NODE_HEALTH_CRITICAL = 3,
4421}
4422impl UavcanNodeHealth {
4423 pub const DEFAULT: Self = Self::UAVCAN_NODE_HEALTH_OK;
4424}
4425impl Default for UavcanNodeHealth {
4426 fn default() -> Self {
4427 Self::DEFAULT
4428 }
4429}
4430#[cfg_attr(feature = "ts", derive(TS))]
4431#[cfg_attr(feature = "ts", ts(export))]
4432#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4433#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4434#[cfg_attr(feature = "serde", serde(tag = "type"))]
4435#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4436#[repr(u32)]
4437#[doc = "Generalized UAVCAN node mode"]
4438pub enum UavcanNodeMode {
4439 #[doc = "The node is performing its primary functions."]
4440 UAVCAN_NODE_MODE_OPERATIONAL = 0,
4441 #[doc = "The node is initializing; this mode is entered immediately after startup."]
4442 UAVCAN_NODE_MODE_INITIALIZATION = 1,
4443 #[doc = "The node is under maintenance."]
4444 UAVCAN_NODE_MODE_MAINTENANCE = 2,
4445 #[doc = "The node is in the process of updating its software."]
4446 UAVCAN_NODE_MODE_SOFTWARE_UPDATE = 3,
4447 #[doc = "The node is no longer available online."]
4448 UAVCAN_NODE_MODE_OFFLINE = 7,
4449}
4450impl UavcanNodeMode {
4451 pub const DEFAULT: Self = Self::UAVCAN_NODE_MODE_OPERATIONAL;
4452}
4453impl Default for UavcanNodeMode {
4454 fn default() -> Self {
4455 Self::DEFAULT
4456 }
4457}
4458bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Flags for the global position report."] pub struct UtmDataAvailFlags : u8 { # [doc = "The field time contains valid data."] const UTM_DATA_AVAIL_FLAGS_TIME_VALID = 1 ; # [doc = "The field uas_id contains valid data."] const UTM_DATA_AVAIL_FLAGS_UAS_ID_AVAILABLE = 2 ; # [doc = "The fields lat, lon and h_acc contain valid data."] const UTM_DATA_AVAIL_FLAGS_POSITION_AVAILABLE = 4 ; # [doc = "The fields alt and v_acc contain valid data."] const UTM_DATA_AVAIL_FLAGS_ALTITUDE_AVAILABLE = 8 ; # [doc = "The field relative_alt contains valid data."] const UTM_DATA_AVAIL_FLAGS_RELATIVE_ALTITUDE_AVAILABLE = 16 ; # [doc = "The fields vx and vy contain valid data."] const UTM_DATA_AVAIL_FLAGS_HORIZONTAL_VELO_AVAILABLE = 32 ; # [doc = "The field vz contains valid data."] const UTM_DATA_AVAIL_FLAGS_VERTICAL_VELO_AVAILABLE = 64 ; # [doc = "The fields next_lat, next_lon and next_alt contain valid data."] const UTM_DATA_AVAIL_FLAGS_NEXT_WAYPOINT_AVAILABLE = 128 ; } }
4459impl UtmDataAvailFlags {
4460 pub const DEFAULT: Self = Self::UTM_DATA_AVAIL_FLAGS_TIME_VALID;
4461}
4462impl Default for UtmDataAvailFlags {
4463 fn default() -> Self {
4464 Self::DEFAULT
4465 }
4466}
4467#[cfg_attr(feature = "ts", derive(TS))]
4468#[cfg_attr(feature = "ts", ts(export))]
4469#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4470#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4471#[cfg_attr(feature = "serde", serde(tag = "type"))]
4472#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4473#[repr(u32)]
4474#[doc = "Airborne status of UAS."]
4475pub enum UtmFlightState {
4476 #[doc = "The flight state can't be determined."]
4477 UTM_FLIGHT_STATE_UNKNOWN = 1,
4478 #[doc = "UAS on ground."]
4479 UTM_FLIGHT_STATE_GROUND = 2,
4480 #[doc = "UAS airborne."]
4481 UTM_FLIGHT_STATE_AIRBORNE = 3,
4482 #[doc = "UAS is in an emergency flight state."]
4483 UTM_FLIGHT_STATE_EMERGENCY = 16,
4484 #[doc = "UAS has no active controls."]
4485 UTM_FLIGHT_STATE_NOCTRL = 32,
4486}
4487impl UtmFlightState {
4488 pub const DEFAULT: Self = Self::UTM_FLIGHT_STATE_UNKNOWN;
4489}
4490impl Default for UtmFlightState {
4491 fn default() -> Self {
4492 Self::DEFAULT
4493 }
4494}
4495#[cfg_attr(feature = "ts", derive(TS))]
4496#[cfg_attr(feature = "ts", ts(export))]
4497#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4498#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4499#[cfg_attr(feature = "serde", serde(tag = "type"))]
4500#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4501#[repr(u32)]
4502#[doc = "Video stream encodings"]
4503pub enum VideoStreamEncoding {
4504 #[doc = "Stream encoding is unknown"]
4505 VIDEO_STREAM_ENCODING_UNKNOWN = 0,
4506 #[doc = "Stream encoding is H.264"]
4507 VIDEO_STREAM_ENCODING_H264 = 1,
4508 #[doc = "Stream encoding is H.265"]
4509 VIDEO_STREAM_ENCODING_H265 = 2,
4510}
4511impl VideoStreamEncoding {
4512 pub const DEFAULT: Self = Self::VIDEO_STREAM_ENCODING_UNKNOWN;
4513}
4514impl Default for VideoStreamEncoding {
4515 fn default() -> Self {
4516 Self::DEFAULT
4517 }
4518}
4519bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Stream status flags (Bitmap)"] pub struct VideoStreamStatusFlags : u16 { # [doc = "Stream is active (running)"] const VIDEO_STREAM_STATUS_FLAGS_RUNNING = 1 ; # [doc = "Stream is thermal imaging"] const VIDEO_STREAM_STATUS_FLAGS_THERMAL = 2 ; # [doc = "Stream can report absolute thermal range (see CAMERA_THERMAL_RANGE)."] const VIDEO_STREAM_STATUS_FLAGS_THERMAL_RANGE_ENABLED = 4 ; } }
4520impl VideoStreamStatusFlags {
4521 pub const DEFAULT: Self = Self::VIDEO_STREAM_STATUS_FLAGS_RUNNING;
4522}
4523impl Default for VideoStreamStatusFlags {
4524 fn default() -> Self {
4525 Self::DEFAULT
4526 }
4527}
4528#[cfg_attr(feature = "ts", derive(TS))]
4529#[cfg_attr(feature = "ts", ts(export))]
4530#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4531#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4532#[cfg_attr(feature = "serde", serde(tag = "type"))]
4533#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4534#[repr(u32)]
4535#[doc = "Video stream types"]
4536pub enum VideoStreamType {
4537 #[doc = "Stream is RTSP"]
4538 VIDEO_STREAM_TYPE_RTSP = 0,
4539 #[doc = "Stream is RTP UDP (URI gives the port number)"]
4540 VIDEO_STREAM_TYPE_RTPUDP = 1,
4541 #[doc = "Stream is MPEG on TCP"]
4542 VIDEO_STREAM_TYPE_TCP_MPEG = 2,
4543 #[doc = "Stream is MPEG TS (URI gives the port number)"]
4544 VIDEO_STREAM_TYPE_MPEG_TS = 3,
4545}
4546impl VideoStreamType {
4547 pub const DEFAULT: Self = Self::VIDEO_STREAM_TYPE_RTSP;
4548}
4549impl Default for VideoStreamType {
4550 fn default() -> Self {
4551 Self::DEFAULT
4552 }
4553}
4554#[cfg_attr(feature = "ts", derive(TS))]
4555#[cfg_attr(feature = "ts", ts(export))]
4556#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4557#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4558#[cfg_attr(feature = "serde", serde(tag = "type"))]
4559#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4560#[repr(u32)]
4561#[doc = "Direction of VTOL transition"]
4562pub enum VtolTransitionHeading {
4563 #[doc = "Respect the heading configuration of the vehicle."]
4564 VTOL_TRANSITION_HEADING_VEHICLE_DEFAULT = 0,
4565 #[doc = "Use the heading pointing towards the next waypoint."]
4566 VTOL_TRANSITION_HEADING_NEXT_WAYPOINT = 1,
4567 #[doc = "Use the heading on takeoff (while sitting on the ground)."]
4568 VTOL_TRANSITION_HEADING_TAKEOFF = 2,
4569 #[doc = "Use the specified heading in parameter 4."]
4570 VTOL_TRANSITION_HEADING_SPECIFIED = 3,
4571 #[doc = "Use the current heading when reaching takeoff altitude (potentially facing the wind when weather-vaning is active)."]
4572 VTOL_TRANSITION_HEADING_ANY = 4,
4573}
4574impl VtolTransitionHeading {
4575 pub const DEFAULT: Self = Self::VTOL_TRANSITION_HEADING_VEHICLE_DEFAULT;
4576}
4577impl Default for VtolTransitionHeading {
4578 fn default() -> Self {
4579 Self::DEFAULT
4580 }
4581}
4582#[cfg_attr(feature = "ts", derive(TS))]
4583#[cfg_attr(feature = "ts", ts(export))]
4584#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4585#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4586#[cfg_attr(feature = "serde", serde(tag = "type"))]
4587#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4588#[repr(u32)]
4589#[doc = "WiFi Mode."]
4590pub enum WifiConfigApMode {
4591 #[doc = "WiFi mode is undefined."]
4592 WIFI_CONFIG_AP_MODE_UNDEFINED = 0,
4593 #[doc = "WiFi configured as an access point."]
4594 WIFI_CONFIG_AP_MODE_AP = 1,
4595 #[doc = "WiFi configured as a station connected to an existing local WiFi network."]
4596 WIFI_CONFIG_AP_MODE_STATION = 2,
4597 #[doc = "WiFi disabled."]
4598 WIFI_CONFIG_AP_MODE_DISABLED = 3,
4599}
4600impl WifiConfigApMode {
4601 pub const DEFAULT: Self = Self::WIFI_CONFIG_AP_MODE_UNDEFINED;
4602}
4603impl Default for WifiConfigApMode {
4604 fn default() -> Self {
4605 Self::DEFAULT
4606 }
4607}
4608#[cfg_attr(feature = "ts", derive(TS))]
4609#[cfg_attr(feature = "ts", ts(export))]
4610#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4611#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4612#[cfg_attr(feature = "serde", serde(tag = "type"))]
4613#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4614#[repr(u32)]
4615#[doc = "Possible responses from a WIFI_CONFIG_AP message."]
4616pub enum WifiConfigApResponse {
4617 #[doc = "Undefined response. Likely an indicative of a system that doesn't support this request."]
4618 WIFI_CONFIG_AP_RESPONSE_UNDEFINED = 0,
4619 #[doc = "Changes accepted."]
4620 WIFI_CONFIG_AP_RESPONSE_ACCEPTED = 1,
4621 #[doc = "Changes rejected."]
4622 WIFI_CONFIG_AP_RESPONSE_REJECTED = 2,
4623 #[doc = "Invalid Mode."]
4624 WIFI_CONFIG_AP_RESPONSE_MODE_ERROR = 3,
4625 #[doc = "Invalid SSID."]
4626 WIFI_CONFIG_AP_RESPONSE_SSID_ERROR = 4,
4627 #[doc = "Invalid Password."]
4628 WIFI_CONFIG_AP_RESPONSE_PASSWORD_ERROR = 5,
4629}
4630impl WifiConfigApResponse {
4631 pub const DEFAULT: Self = Self::WIFI_CONFIG_AP_RESPONSE_UNDEFINED;
4632}
4633impl Default for WifiConfigApResponse {
4634 fn default() -> Self {
4635 Self::DEFAULT
4636 }
4637}
4638#[cfg_attr(feature = "ts", derive(TS))]
4639#[cfg_attr(feature = "ts", ts(export))]
4640#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4641#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4642#[cfg_attr(feature = "serde", serde(tag = "type"))]
4643#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4644#[repr(u32)]
4645#[doc = "Winch actions."]
4646pub enum WinchActions {
4647 #[doc = "Allow motor to freewheel."]
4648 WINCH_RELAXED = 0,
4649 #[doc = "Wind or unwind specified length of line, optionally using specified rate."]
4650 WINCH_RELATIVE_LENGTH_CONTROL = 1,
4651 #[doc = "Wind or unwind line at specified rate."]
4652 WINCH_RATE_CONTROL = 2,
4653 #[doc = "Perform the locking sequence to relieve motor while in the fully retracted position. Only action and instance command parameters are used, others are ignored."]
4654 WINCH_LOCK = 3,
4655 #[doc = "Sequence of drop, slow down, touch down, reel up, lock. Only action and instance command parameters are used, others are ignored."]
4656 WINCH_DELIVER = 4,
4657 #[doc = "Engage motor and hold current position. Only action and instance command parameters are used, others are ignored."]
4658 WINCH_HOLD = 5,
4659 #[doc = "Return the reel to the fully retracted position. Only action and instance command parameters are used, others are ignored."]
4660 WINCH_RETRACT = 6,
4661 #[doc = "Load the reel with line. The winch will calculate the total loaded length and stop when the tension exceeds a threshold. Only action and instance command parameters are used, others are ignored."]
4662 WINCH_LOAD_LINE = 7,
4663 #[doc = "Spool out the entire length of the line. Only action and instance command parameters are used, others are ignored."]
4664 WINCH_ABANDON_LINE = 8,
4665 #[doc = "Spools out just enough to present the hook to the user to load the payload. Only action and instance command parameters are used, others are ignored"]
4666 WINCH_LOAD_PAYLOAD = 9,
4667}
4668impl WinchActions {
4669 pub const DEFAULT: Self = Self::WINCH_RELAXED;
4670}
4671impl Default for WinchActions {
4672 fn default() -> Self {
4673 Self::DEFAULT
4674 }
4675}
4676#[doc = "Set the vehicle attitude and body angular rates."]
4677#[doc = ""]
4678#[doc = "ID: 140"]
4679#[derive(Debug, Clone, PartialEq)]
4680#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4681#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4682#[cfg_attr(feature = "ts", derive(TS))]
4683#[cfg_attr(feature = "ts", ts(export))]
4684pub struct ACTUATOR_CONTROL_TARGET_DATA {
4685 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
4686 pub time_usec: u64,
4687 #[doc = "Actuator controls. Normed to -1..+1 where 0 is neutral position. Throttle for single rotation direction motors is 0..1, negative range for reverse direction. Standard mapping for attitude controls (group 0): (index 0-7): roll, pitch, yaw, throttle, flaps, spoilers, airbrakes, landing gear. Load a pass-through mixer to repurpose them as generic outputs."]
4688 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
4689 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
4690 pub controls: [f32; 8],
4691 #[doc = "Actuator group. The \"_mlx\" indicates this is a multi-instance message and a MAVLink parser should use this field to difference between instances."]
4692 pub group_mlx: u8,
4693}
4694impl ACTUATOR_CONTROL_TARGET_DATA {
4695 pub const ENCODED_LEN: usize = 41usize;
4696 pub const DEFAULT: Self = Self {
4697 time_usec: 0_u64,
4698 controls: [0.0_f32; 8usize],
4699 group_mlx: 0_u8,
4700 };
4701 #[cfg(feature = "arbitrary")]
4702 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
4703 use arbitrary::{Arbitrary, Unstructured};
4704 let mut buf = [0u8; 1024];
4705 rng.fill_bytes(&mut buf);
4706 let mut unstructured = Unstructured::new(&buf);
4707 Self::arbitrary(&mut unstructured).unwrap_or_default()
4708 }
4709}
4710impl Default for ACTUATOR_CONTROL_TARGET_DATA {
4711 fn default() -> Self {
4712 Self::DEFAULT.clone()
4713 }
4714}
4715impl MessageData for ACTUATOR_CONTROL_TARGET_DATA {
4716 type Message = MavMessage;
4717 const ID: u32 = 140u32;
4718 const NAME: &'static str = "ACTUATOR_CONTROL_TARGET";
4719 const EXTRA_CRC: u8 = 181u8;
4720 const ENCODED_LEN: usize = 41usize;
4721 fn deser(
4722 _version: MavlinkVersion,
4723 __input: &[u8],
4724 ) -> Result<Self, ::mavlink_core::error::ParserError> {
4725 let avail_len = __input.len();
4726 let mut payload_buf = [0; Self::ENCODED_LEN];
4727 let mut buf = if avail_len < Self::ENCODED_LEN {
4728 payload_buf[0..avail_len].copy_from_slice(__input);
4729 Bytes::new(&payload_buf)
4730 } else {
4731 Bytes::new(__input)
4732 };
4733 let mut __struct = Self::default();
4734 __struct.time_usec = buf.get_u64_le();
4735 for v in &mut __struct.controls {
4736 let val = buf.get_f32_le();
4737 *v = val;
4738 }
4739 __struct.group_mlx = buf.get_u8();
4740 Ok(__struct)
4741 }
4742 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
4743 let mut __tmp = BytesMut::new(bytes);
4744 #[allow(clippy::absurd_extreme_comparisons)]
4745 #[allow(unused_comparisons)]
4746 if __tmp.remaining() < Self::ENCODED_LEN {
4747 panic!(
4748 "buffer is too small (need {} bytes, but got {})",
4749 Self::ENCODED_LEN,
4750 __tmp.remaining(),
4751 )
4752 }
4753 __tmp.put_u64_le(self.time_usec);
4754 for val in &self.controls {
4755 __tmp.put_f32_le(*val);
4756 }
4757 __tmp.put_u8(self.group_mlx);
4758 if matches!(version, MavlinkVersion::V2) {
4759 let len = __tmp.len();
4760 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
4761 } else {
4762 __tmp.len()
4763 }
4764 }
4765}
4766#[doc = "The raw values of the actuator outputs (e.g. on Pixhawk, from MAIN, AUX ports). This message supersedes SERVO_OUTPUT_RAW."]
4767#[doc = ""]
4768#[doc = "ID: 375"]
4769#[derive(Debug, Clone, PartialEq)]
4770#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4771#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4772#[cfg_attr(feature = "ts", derive(TS))]
4773#[cfg_attr(feature = "ts", ts(export))]
4774pub struct ACTUATOR_OUTPUT_STATUS_DATA {
4775 #[doc = "Timestamp (since system boot)."]
4776 pub time_usec: u64,
4777 #[doc = "Active outputs"]
4778 pub active: u32,
4779 #[doc = "Servo / motor output array values. Zero values indicate unused channels."]
4780 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
4781 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
4782 pub actuator: [f32; 32],
4783}
4784impl ACTUATOR_OUTPUT_STATUS_DATA {
4785 pub const ENCODED_LEN: usize = 140usize;
4786 pub const DEFAULT: Self = Self {
4787 time_usec: 0_u64,
4788 active: 0_u32,
4789 actuator: [0.0_f32; 32usize],
4790 };
4791 #[cfg(feature = "arbitrary")]
4792 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
4793 use arbitrary::{Arbitrary, Unstructured};
4794 let mut buf = [0u8; 1024];
4795 rng.fill_bytes(&mut buf);
4796 let mut unstructured = Unstructured::new(&buf);
4797 Self::arbitrary(&mut unstructured).unwrap_or_default()
4798 }
4799}
4800impl Default for ACTUATOR_OUTPUT_STATUS_DATA {
4801 fn default() -> Self {
4802 Self::DEFAULT.clone()
4803 }
4804}
4805impl MessageData for ACTUATOR_OUTPUT_STATUS_DATA {
4806 type Message = MavMessage;
4807 const ID: u32 = 375u32;
4808 const NAME: &'static str = "ACTUATOR_OUTPUT_STATUS";
4809 const EXTRA_CRC: u8 = 251u8;
4810 const ENCODED_LEN: usize = 140usize;
4811 fn deser(
4812 _version: MavlinkVersion,
4813 __input: &[u8],
4814 ) -> Result<Self, ::mavlink_core::error::ParserError> {
4815 let avail_len = __input.len();
4816 let mut payload_buf = [0; Self::ENCODED_LEN];
4817 let mut buf = if avail_len < Self::ENCODED_LEN {
4818 payload_buf[0..avail_len].copy_from_slice(__input);
4819 Bytes::new(&payload_buf)
4820 } else {
4821 Bytes::new(__input)
4822 };
4823 let mut __struct = Self::default();
4824 __struct.time_usec = buf.get_u64_le();
4825 __struct.active = buf.get_u32_le();
4826 for v in &mut __struct.actuator {
4827 let val = buf.get_f32_le();
4828 *v = val;
4829 }
4830 Ok(__struct)
4831 }
4832 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
4833 let mut __tmp = BytesMut::new(bytes);
4834 #[allow(clippy::absurd_extreme_comparisons)]
4835 #[allow(unused_comparisons)]
4836 if __tmp.remaining() < Self::ENCODED_LEN {
4837 panic!(
4838 "buffer is too small (need {} bytes, but got {})",
4839 Self::ENCODED_LEN,
4840 __tmp.remaining(),
4841 )
4842 }
4843 __tmp.put_u64_le(self.time_usec);
4844 __tmp.put_u32_le(self.active);
4845 for val in &self.actuator {
4846 __tmp.put_f32_le(*val);
4847 }
4848 if matches!(version, MavlinkVersion::V2) {
4849 let len = __tmp.len();
4850 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
4851 } else {
4852 __tmp.len()
4853 }
4854 }
4855}
4856#[doc = "The location and information of an ADSB vehicle."]
4857#[doc = ""]
4858#[doc = "ID: 246"]
4859#[derive(Debug, Clone, PartialEq)]
4860#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4861#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4862#[cfg_attr(feature = "ts", derive(TS))]
4863#[cfg_attr(feature = "ts", ts(export))]
4864pub struct ADSB_VEHICLE_DATA {
4865 #[doc = "ICAO address"]
4866 pub ICAO_address: u32,
4867 #[doc = "Latitude"]
4868 pub lat: i32,
4869 #[doc = "Longitude"]
4870 pub lon: i32,
4871 #[doc = "Altitude(ASL)"]
4872 pub altitude: i32,
4873 #[doc = "Course over ground"]
4874 pub heading: u16,
4875 #[doc = "The horizontal velocity"]
4876 pub hor_velocity: u16,
4877 #[doc = "The vertical velocity. Positive is up"]
4878 pub ver_velocity: i16,
4879 #[doc = "Bitmap to indicate various statuses including valid data fields"]
4880 pub flags: AdsbFlags,
4881 #[doc = "Squawk code. Note that the code is in decimal: e.g. 7700 (general emergency) is encoded as binary 0b0001_1110_0001_0100, not(!) as 0b0000_111_111_000_000"]
4882 pub squawk: u16,
4883 #[doc = "ADSB altitude type."]
4884 pub altitude_type: AdsbAltitudeType,
4885 #[doc = "The callsign, 8+null"]
4886 #[cfg_attr(feature = "ts", ts(type = "string"))]
4887 pub callsign: CharArray<9>,
4888 #[doc = "ADSB emitter type."]
4889 pub emitter_type: AdsbEmitterType,
4890 #[doc = "Time since last communication in seconds"]
4891 pub tslc: u8,
4892}
4893impl ADSB_VEHICLE_DATA {
4894 pub const ENCODED_LEN: usize = 38usize;
4895 pub const DEFAULT: Self = Self {
4896 ICAO_address: 0_u32,
4897 lat: 0_i32,
4898 lon: 0_i32,
4899 altitude: 0_i32,
4900 heading: 0_u16,
4901 hor_velocity: 0_u16,
4902 ver_velocity: 0_i16,
4903 flags: AdsbFlags::DEFAULT,
4904 squawk: 0_u16,
4905 altitude_type: AdsbAltitudeType::DEFAULT,
4906 callsign: CharArray::new([0_u8; 9usize]),
4907 emitter_type: AdsbEmitterType::DEFAULT,
4908 tslc: 0_u8,
4909 };
4910 #[cfg(feature = "arbitrary")]
4911 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
4912 use arbitrary::{Arbitrary, Unstructured};
4913 let mut buf = [0u8; 1024];
4914 rng.fill_bytes(&mut buf);
4915 let mut unstructured = Unstructured::new(&buf);
4916 Self::arbitrary(&mut unstructured).unwrap_or_default()
4917 }
4918}
4919impl Default for ADSB_VEHICLE_DATA {
4920 fn default() -> Self {
4921 Self::DEFAULT.clone()
4922 }
4923}
4924impl MessageData for ADSB_VEHICLE_DATA {
4925 type Message = MavMessage;
4926 const ID: u32 = 246u32;
4927 const NAME: &'static str = "ADSB_VEHICLE";
4928 const EXTRA_CRC: u8 = 184u8;
4929 const ENCODED_LEN: usize = 38usize;
4930 fn deser(
4931 _version: MavlinkVersion,
4932 __input: &[u8],
4933 ) -> Result<Self, ::mavlink_core::error::ParserError> {
4934 let avail_len = __input.len();
4935 let mut payload_buf = [0; Self::ENCODED_LEN];
4936 let mut buf = if avail_len < Self::ENCODED_LEN {
4937 payload_buf[0..avail_len].copy_from_slice(__input);
4938 Bytes::new(&payload_buf)
4939 } else {
4940 Bytes::new(__input)
4941 };
4942 let mut __struct = Self::default();
4943 __struct.ICAO_address = buf.get_u32_le();
4944 __struct.lat = buf.get_i32_le();
4945 __struct.lon = buf.get_i32_le();
4946 __struct.altitude = buf.get_i32_le();
4947 __struct.heading = buf.get_u16_le();
4948 __struct.hor_velocity = buf.get_u16_le();
4949 __struct.ver_velocity = buf.get_i16_le();
4950 let tmp = buf.get_u16_le();
4951 __struct.flags = AdsbFlags::from_bits(tmp as <AdsbFlags as Flags>::Bits).ok_or(
4952 ::mavlink_core::error::ParserError::InvalidFlag {
4953 flag_type: "AdsbFlags",
4954 value: tmp as u64,
4955 },
4956 )?;
4957 __struct.squawk = buf.get_u16_le();
4958 let tmp = buf.get_u8();
4959 __struct.altitude_type =
4960 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
4961 enum_type: "AdsbAltitudeType",
4962 value: tmp as u64,
4963 })?;
4964 let mut tmp = [0_u8; 9usize];
4965 for v in &mut tmp {
4966 *v = buf.get_u8();
4967 }
4968 __struct.callsign = CharArray::new(tmp);
4969 let tmp = buf.get_u8();
4970 __struct.emitter_type =
4971 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
4972 enum_type: "AdsbEmitterType",
4973 value: tmp as u64,
4974 })?;
4975 __struct.tslc = buf.get_u8();
4976 Ok(__struct)
4977 }
4978 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
4979 let mut __tmp = BytesMut::new(bytes);
4980 #[allow(clippy::absurd_extreme_comparisons)]
4981 #[allow(unused_comparisons)]
4982 if __tmp.remaining() < Self::ENCODED_LEN {
4983 panic!(
4984 "buffer is too small (need {} bytes, but got {})",
4985 Self::ENCODED_LEN,
4986 __tmp.remaining(),
4987 )
4988 }
4989 __tmp.put_u32_le(self.ICAO_address);
4990 __tmp.put_i32_le(self.lat);
4991 __tmp.put_i32_le(self.lon);
4992 __tmp.put_i32_le(self.altitude);
4993 __tmp.put_u16_le(self.heading);
4994 __tmp.put_u16_le(self.hor_velocity);
4995 __tmp.put_i16_le(self.ver_velocity);
4996 __tmp.put_u16_le(self.flags.bits() as u16);
4997 __tmp.put_u16_le(self.squawk);
4998 __tmp.put_u8(self.altitude_type as u8);
4999 for val in &self.callsign {
5000 __tmp.put_u8(*val);
5001 }
5002 __tmp.put_u8(self.emitter_type as u8);
5003 __tmp.put_u8(self.tslc);
5004 if matches!(version, MavlinkVersion::V2) {
5005 let len = __tmp.len();
5006 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
5007 } else {
5008 __tmp.len()
5009 }
5010 }
5011}
5012#[doc = "The location and information of an AIS vessel."]
5013#[doc = ""]
5014#[doc = "ID: 301"]
5015#[derive(Debug, Clone, PartialEq)]
5016#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
5017#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
5018#[cfg_attr(feature = "ts", derive(TS))]
5019#[cfg_attr(feature = "ts", ts(export))]
5020pub struct AIS_VESSEL_DATA {
5021 #[doc = "Mobile Marine Service Identifier, 9 decimal digits"]
5022 pub MMSI: u32,
5023 #[doc = "Latitude"]
5024 pub lat: i32,
5025 #[doc = "Longitude"]
5026 pub lon: i32,
5027 #[doc = "Course over ground"]
5028 pub COG: u16,
5029 #[doc = "True heading"]
5030 pub heading: u16,
5031 #[doc = "Speed over ground"]
5032 pub velocity: u16,
5033 #[doc = "Distance from lat/lon location to bow"]
5034 pub dimension_bow: u16,
5035 #[doc = "Distance from lat/lon location to stern"]
5036 pub dimension_stern: u16,
5037 #[doc = "Time since last communication in seconds"]
5038 pub tslc: u16,
5039 #[doc = "Bitmask to indicate various statuses including valid data fields"]
5040 pub flags: AisFlags,
5041 #[doc = "Turn rate"]
5042 pub turn_rate: i8,
5043 #[doc = "Navigational status"]
5044 pub navigational_status: AisNavStatus,
5045 #[doc = "Type of vessels"]
5046 pub mavtype: AisType,
5047 #[doc = "Distance from lat/lon location to port side"]
5048 pub dimension_port: u8,
5049 #[doc = "Distance from lat/lon location to starboard side"]
5050 pub dimension_starboard: u8,
5051 #[doc = "The vessel callsign"]
5052 #[cfg_attr(feature = "ts", ts(type = "string"))]
5053 pub callsign: CharArray<7>,
5054 #[doc = "The vessel name"]
5055 #[cfg_attr(feature = "ts", ts(type = "string"))]
5056 pub name: CharArray<20>,
5057}
5058impl AIS_VESSEL_DATA {
5059 pub const ENCODED_LEN: usize = 58usize;
5060 pub const DEFAULT: Self = Self {
5061 MMSI: 0_u32,
5062 lat: 0_i32,
5063 lon: 0_i32,
5064 COG: 0_u16,
5065 heading: 0_u16,
5066 velocity: 0_u16,
5067 dimension_bow: 0_u16,
5068 dimension_stern: 0_u16,
5069 tslc: 0_u16,
5070 flags: AisFlags::DEFAULT,
5071 turn_rate: 0_i8,
5072 navigational_status: AisNavStatus::DEFAULT,
5073 mavtype: AisType::DEFAULT,
5074 dimension_port: 0_u8,
5075 dimension_starboard: 0_u8,
5076 callsign: CharArray::new([0_u8; 7usize]),
5077 name: CharArray::new([0_u8; 20usize]),
5078 };
5079 #[cfg(feature = "arbitrary")]
5080 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
5081 use arbitrary::{Arbitrary, Unstructured};
5082 let mut buf = [0u8; 1024];
5083 rng.fill_bytes(&mut buf);
5084 let mut unstructured = Unstructured::new(&buf);
5085 Self::arbitrary(&mut unstructured).unwrap_or_default()
5086 }
5087}
5088impl Default for AIS_VESSEL_DATA {
5089 fn default() -> Self {
5090 Self::DEFAULT.clone()
5091 }
5092}
5093impl MessageData for AIS_VESSEL_DATA {
5094 type Message = MavMessage;
5095 const ID: u32 = 301u32;
5096 const NAME: &'static str = "AIS_VESSEL";
5097 const EXTRA_CRC: u8 = 243u8;
5098 const ENCODED_LEN: usize = 58usize;
5099 fn deser(
5100 _version: MavlinkVersion,
5101 __input: &[u8],
5102 ) -> Result<Self, ::mavlink_core::error::ParserError> {
5103 let avail_len = __input.len();
5104 let mut payload_buf = [0; Self::ENCODED_LEN];
5105 let mut buf = if avail_len < Self::ENCODED_LEN {
5106 payload_buf[0..avail_len].copy_from_slice(__input);
5107 Bytes::new(&payload_buf)
5108 } else {
5109 Bytes::new(__input)
5110 };
5111 let mut __struct = Self::default();
5112 __struct.MMSI = buf.get_u32_le();
5113 __struct.lat = buf.get_i32_le();
5114 __struct.lon = buf.get_i32_le();
5115 __struct.COG = buf.get_u16_le();
5116 __struct.heading = buf.get_u16_le();
5117 __struct.velocity = buf.get_u16_le();
5118 __struct.dimension_bow = buf.get_u16_le();
5119 __struct.dimension_stern = buf.get_u16_le();
5120 __struct.tslc = buf.get_u16_le();
5121 let tmp = buf.get_u16_le();
5122 __struct.flags = AisFlags::from_bits(tmp as <AisFlags as Flags>::Bits).ok_or(
5123 ::mavlink_core::error::ParserError::InvalidFlag {
5124 flag_type: "AisFlags",
5125 value: tmp as u64,
5126 },
5127 )?;
5128 __struct.turn_rate = buf.get_i8();
5129 let tmp = buf.get_u8();
5130 __struct.navigational_status =
5131 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
5132 enum_type: "AisNavStatus",
5133 value: tmp as u64,
5134 })?;
5135 let tmp = buf.get_u8();
5136 __struct.mavtype =
5137 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
5138 enum_type: "AisType",
5139 value: tmp as u64,
5140 })?;
5141 __struct.dimension_port = buf.get_u8();
5142 __struct.dimension_starboard = buf.get_u8();
5143 let mut tmp = [0_u8; 7usize];
5144 for v in &mut tmp {
5145 *v = buf.get_u8();
5146 }
5147 __struct.callsign = CharArray::new(tmp);
5148 let mut tmp = [0_u8; 20usize];
5149 for v in &mut tmp {
5150 *v = buf.get_u8();
5151 }
5152 __struct.name = CharArray::new(tmp);
5153 Ok(__struct)
5154 }
5155 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
5156 let mut __tmp = BytesMut::new(bytes);
5157 #[allow(clippy::absurd_extreme_comparisons)]
5158 #[allow(unused_comparisons)]
5159 if __tmp.remaining() < Self::ENCODED_LEN {
5160 panic!(
5161 "buffer is too small (need {} bytes, but got {})",
5162 Self::ENCODED_LEN,
5163 __tmp.remaining(),
5164 )
5165 }
5166 __tmp.put_u32_le(self.MMSI);
5167 __tmp.put_i32_le(self.lat);
5168 __tmp.put_i32_le(self.lon);
5169 __tmp.put_u16_le(self.COG);
5170 __tmp.put_u16_le(self.heading);
5171 __tmp.put_u16_le(self.velocity);
5172 __tmp.put_u16_le(self.dimension_bow);
5173 __tmp.put_u16_le(self.dimension_stern);
5174 __tmp.put_u16_le(self.tslc);
5175 __tmp.put_u16_le(self.flags.bits() as u16);
5176 __tmp.put_i8(self.turn_rate);
5177 __tmp.put_u8(self.navigational_status as u8);
5178 __tmp.put_u8(self.mavtype as u8);
5179 __tmp.put_u8(self.dimension_port);
5180 __tmp.put_u8(self.dimension_starboard);
5181 for val in &self.callsign {
5182 __tmp.put_u8(*val);
5183 }
5184 for val in &self.name {
5185 __tmp.put_u8(*val);
5186 }
5187 if matches!(version, MavlinkVersion::V2) {
5188 let len = __tmp.len();
5189 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
5190 } else {
5191 __tmp.len()
5192 }
5193 }
5194}
5195#[doc = "The current system altitude."]
5196#[doc = ""]
5197#[doc = "ID: 141"]
5198#[derive(Debug, Clone, PartialEq)]
5199#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
5200#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
5201#[cfg_attr(feature = "ts", derive(TS))]
5202#[cfg_attr(feature = "ts", ts(export))]
5203pub struct ALTITUDE_DATA {
5204 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
5205 pub time_usec: u64,
5206 #[doc = "This altitude measure is initialized on system boot and monotonic (it is never reset, but represents the local altitude change). The only guarantee on this field is that it will never be reset and is consistent within a flight. The recommended value for this field is the uncorrected barometric altitude at boot time. This altitude will also drift and vary between flights."]
5207 pub altitude_monotonic: f32,
5208 #[doc = "This altitude measure is strictly above mean sea level and might be non-monotonic (it might reset on events like GPS lock or when a new QNH value is set). It should be the altitude to which global altitude waypoints are compared to. Note that it is *not* the GPS altitude, however, most GPS modules already output MSL by default and not the WGS84 altitude."]
5209 pub altitude_amsl: f32,
5210 #[doc = "This is the local altitude in the local coordinate frame. It is not the altitude above home, but in reference to the coordinate origin (0, 0, 0). It is up-positive."]
5211 pub altitude_local: f32,
5212 #[doc = "This is the altitude above the home position. It resets on each change of the current home position."]
5213 pub altitude_relative: f32,
5214 #[doc = "This is the altitude above terrain. It might be fed by a terrain database or an altimeter. Values smaller than -1000 should be interpreted as unknown."]
5215 pub altitude_terrain: f32,
5216 #[doc = "This is not the altitude, but the clear space below the system according to the fused clearance estimate. It generally should max out at the maximum range of e.g. the laser altimeter. It is generally a moving target. A negative value indicates no measurement available."]
5217 pub bottom_clearance: f32,
5218}
5219impl ALTITUDE_DATA {
5220 pub const ENCODED_LEN: usize = 32usize;
5221 pub const DEFAULT: Self = Self {
5222 time_usec: 0_u64,
5223 altitude_monotonic: 0.0_f32,
5224 altitude_amsl: 0.0_f32,
5225 altitude_local: 0.0_f32,
5226 altitude_relative: 0.0_f32,
5227 altitude_terrain: 0.0_f32,
5228 bottom_clearance: 0.0_f32,
5229 };
5230 #[cfg(feature = "arbitrary")]
5231 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
5232 use arbitrary::{Arbitrary, Unstructured};
5233 let mut buf = [0u8; 1024];
5234 rng.fill_bytes(&mut buf);
5235 let mut unstructured = Unstructured::new(&buf);
5236 Self::arbitrary(&mut unstructured).unwrap_or_default()
5237 }
5238}
5239impl Default for ALTITUDE_DATA {
5240 fn default() -> Self {
5241 Self::DEFAULT.clone()
5242 }
5243}
5244impl MessageData for ALTITUDE_DATA {
5245 type Message = MavMessage;
5246 const ID: u32 = 141u32;
5247 const NAME: &'static str = "ALTITUDE";
5248 const EXTRA_CRC: u8 = 47u8;
5249 const ENCODED_LEN: usize = 32usize;
5250 fn deser(
5251 _version: MavlinkVersion,
5252 __input: &[u8],
5253 ) -> Result<Self, ::mavlink_core::error::ParserError> {
5254 let avail_len = __input.len();
5255 let mut payload_buf = [0; Self::ENCODED_LEN];
5256 let mut buf = if avail_len < Self::ENCODED_LEN {
5257 payload_buf[0..avail_len].copy_from_slice(__input);
5258 Bytes::new(&payload_buf)
5259 } else {
5260 Bytes::new(__input)
5261 };
5262 let mut __struct = Self::default();
5263 __struct.time_usec = buf.get_u64_le();
5264 __struct.altitude_monotonic = buf.get_f32_le();
5265 __struct.altitude_amsl = buf.get_f32_le();
5266 __struct.altitude_local = buf.get_f32_le();
5267 __struct.altitude_relative = buf.get_f32_le();
5268 __struct.altitude_terrain = buf.get_f32_le();
5269 __struct.bottom_clearance = buf.get_f32_le();
5270 Ok(__struct)
5271 }
5272 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
5273 let mut __tmp = BytesMut::new(bytes);
5274 #[allow(clippy::absurd_extreme_comparisons)]
5275 #[allow(unused_comparisons)]
5276 if __tmp.remaining() < Self::ENCODED_LEN {
5277 panic!(
5278 "buffer is too small (need {} bytes, but got {})",
5279 Self::ENCODED_LEN,
5280 __tmp.remaining(),
5281 )
5282 }
5283 __tmp.put_u64_le(self.time_usec);
5284 __tmp.put_f32_le(self.altitude_monotonic);
5285 __tmp.put_f32_le(self.altitude_amsl);
5286 __tmp.put_f32_le(self.altitude_local);
5287 __tmp.put_f32_le(self.altitude_relative);
5288 __tmp.put_f32_le(self.altitude_terrain);
5289 __tmp.put_f32_le(self.bottom_clearance);
5290 if matches!(version, MavlinkVersion::V2) {
5291 let len = __tmp.len();
5292 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
5293 } else {
5294 __tmp.len()
5295 }
5296 }
5297}
5298#[doc = "The attitude in the aeronautical frame (right-handed, Z-down, Y-right, X-front, ZYX, intrinsic)."]
5299#[doc = ""]
5300#[doc = "ID: 30"]
5301#[derive(Debug, Clone, PartialEq)]
5302#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
5303#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
5304#[cfg_attr(feature = "ts", derive(TS))]
5305#[cfg_attr(feature = "ts", ts(export))]
5306pub struct ATTITUDE_DATA {
5307 #[doc = "Timestamp (time since system boot)."]
5308 pub time_boot_ms: u32,
5309 #[doc = "Roll angle (-pi..+pi)"]
5310 pub roll: f32,
5311 #[doc = "Pitch angle (-pi..+pi)"]
5312 pub pitch: f32,
5313 #[doc = "Yaw angle (-pi..+pi)"]
5314 pub yaw: f32,
5315 #[doc = "Roll angular speed"]
5316 pub rollspeed: f32,
5317 #[doc = "Pitch angular speed"]
5318 pub pitchspeed: f32,
5319 #[doc = "Yaw angular speed"]
5320 pub yawspeed: f32,
5321}
5322impl ATTITUDE_DATA {
5323 pub const ENCODED_LEN: usize = 28usize;
5324 pub const DEFAULT: Self = Self {
5325 time_boot_ms: 0_u32,
5326 roll: 0.0_f32,
5327 pitch: 0.0_f32,
5328 yaw: 0.0_f32,
5329 rollspeed: 0.0_f32,
5330 pitchspeed: 0.0_f32,
5331 yawspeed: 0.0_f32,
5332 };
5333 #[cfg(feature = "arbitrary")]
5334 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
5335 use arbitrary::{Arbitrary, Unstructured};
5336 let mut buf = [0u8; 1024];
5337 rng.fill_bytes(&mut buf);
5338 let mut unstructured = Unstructured::new(&buf);
5339 Self::arbitrary(&mut unstructured).unwrap_or_default()
5340 }
5341}
5342impl Default for ATTITUDE_DATA {
5343 fn default() -> Self {
5344 Self::DEFAULT.clone()
5345 }
5346}
5347impl MessageData for ATTITUDE_DATA {
5348 type Message = MavMessage;
5349 const ID: u32 = 30u32;
5350 const NAME: &'static str = "ATTITUDE";
5351 const EXTRA_CRC: u8 = 39u8;
5352 const ENCODED_LEN: usize = 28usize;
5353 fn deser(
5354 _version: MavlinkVersion,
5355 __input: &[u8],
5356 ) -> Result<Self, ::mavlink_core::error::ParserError> {
5357 let avail_len = __input.len();
5358 let mut payload_buf = [0; Self::ENCODED_LEN];
5359 let mut buf = if avail_len < Self::ENCODED_LEN {
5360 payload_buf[0..avail_len].copy_from_slice(__input);
5361 Bytes::new(&payload_buf)
5362 } else {
5363 Bytes::new(__input)
5364 };
5365 let mut __struct = Self::default();
5366 __struct.time_boot_ms = buf.get_u32_le();
5367 __struct.roll = buf.get_f32_le();
5368 __struct.pitch = buf.get_f32_le();
5369 __struct.yaw = buf.get_f32_le();
5370 __struct.rollspeed = buf.get_f32_le();
5371 __struct.pitchspeed = buf.get_f32_le();
5372 __struct.yawspeed = buf.get_f32_le();
5373 Ok(__struct)
5374 }
5375 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
5376 let mut __tmp = BytesMut::new(bytes);
5377 #[allow(clippy::absurd_extreme_comparisons)]
5378 #[allow(unused_comparisons)]
5379 if __tmp.remaining() < Self::ENCODED_LEN {
5380 panic!(
5381 "buffer is too small (need {} bytes, but got {})",
5382 Self::ENCODED_LEN,
5383 __tmp.remaining(),
5384 )
5385 }
5386 __tmp.put_u32_le(self.time_boot_ms);
5387 __tmp.put_f32_le(self.roll);
5388 __tmp.put_f32_le(self.pitch);
5389 __tmp.put_f32_le(self.yaw);
5390 __tmp.put_f32_le(self.rollspeed);
5391 __tmp.put_f32_le(self.pitchspeed);
5392 __tmp.put_f32_le(self.yawspeed);
5393 if matches!(version, MavlinkVersion::V2) {
5394 let len = __tmp.len();
5395 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
5396 } else {
5397 __tmp.len()
5398 }
5399 }
5400}
5401#[doc = "The attitude in the aeronautical frame (right-handed, Z-down, X-front, Y-right), expressed as quaternion. Quaternion order is w, x, y, z and a zero rotation would be expressed as (1 0 0 0)."]
5402#[doc = ""]
5403#[doc = "ID: 31"]
5404#[derive(Debug, Clone, PartialEq)]
5405#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
5406#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
5407#[cfg_attr(feature = "ts", derive(TS))]
5408#[cfg_attr(feature = "ts", ts(export))]
5409pub struct ATTITUDE_QUATERNION_DATA {
5410 #[doc = "Timestamp (time since system boot)."]
5411 pub time_boot_ms: u32,
5412 #[doc = "Quaternion component 1, w (1 in null-rotation)"]
5413 pub q1: f32,
5414 #[doc = "Quaternion component 2, x (0 in null-rotation)"]
5415 pub q2: f32,
5416 #[doc = "Quaternion component 3, y (0 in null-rotation)"]
5417 pub q3: f32,
5418 #[doc = "Quaternion component 4, z (0 in null-rotation)"]
5419 pub q4: f32,
5420 #[doc = "Roll angular speed"]
5421 pub rollspeed: f32,
5422 #[doc = "Pitch angular speed"]
5423 pub pitchspeed: f32,
5424 #[doc = "Yaw angular speed"]
5425 pub yawspeed: f32,
5426 #[doc = "Rotation offset by which the attitude quaternion and angular speed vector should be rotated for user display (quaternion with [w, x, y, z] order, zero-rotation is [1, 0, 0, 0], send [0, 0, 0, 0] if field not supported). This field is intended for systems in which the reference attitude may change during flight. For example, tailsitters VTOLs rotate their reference attitude by 90 degrees between hover mode and fixed wing mode, thus repr_offset_q is equal to [1, 0, 0, 0] in hover mode and equal to [0.7071, 0, 0.7071, 0] in fixed wing mode."]
5427 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
5428 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
5429 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
5430 pub repr_offset_q: [f32; 4],
5431}
5432impl ATTITUDE_QUATERNION_DATA {
5433 pub const ENCODED_LEN: usize = 48usize;
5434 pub const DEFAULT: Self = Self {
5435 time_boot_ms: 0_u32,
5436 q1: 0.0_f32,
5437 q2: 0.0_f32,
5438 q3: 0.0_f32,
5439 q4: 0.0_f32,
5440 rollspeed: 0.0_f32,
5441 pitchspeed: 0.0_f32,
5442 yawspeed: 0.0_f32,
5443 repr_offset_q: [0.0_f32; 4usize],
5444 };
5445 #[cfg(feature = "arbitrary")]
5446 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
5447 use arbitrary::{Arbitrary, Unstructured};
5448 let mut buf = [0u8; 1024];
5449 rng.fill_bytes(&mut buf);
5450 let mut unstructured = Unstructured::new(&buf);
5451 Self::arbitrary(&mut unstructured).unwrap_or_default()
5452 }
5453}
5454impl Default for ATTITUDE_QUATERNION_DATA {
5455 fn default() -> Self {
5456 Self::DEFAULT.clone()
5457 }
5458}
5459impl MessageData for ATTITUDE_QUATERNION_DATA {
5460 type Message = MavMessage;
5461 const ID: u32 = 31u32;
5462 const NAME: &'static str = "ATTITUDE_QUATERNION";
5463 const EXTRA_CRC: u8 = 246u8;
5464 const ENCODED_LEN: usize = 48usize;
5465 fn deser(
5466 _version: MavlinkVersion,
5467 __input: &[u8],
5468 ) -> Result<Self, ::mavlink_core::error::ParserError> {
5469 let avail_len = __input.len();
5470 let mut payload_buf = [0; Self::ENCODED_LEN];
5471 let mut buf = if avail_len < Self::ENCODED_LEN {
5472 payload_buf[0..avail_len].copy_from_slice(__input);
5473 Bytes::new(&payload_buf)
5474 } else {
5475 Bytes::new(__input)
5476 };
5477 let mut __struct = Self::default();
5478 __struct.time_boot_ms = buf.get_u32_le();
5479 __struct.q1 = buf.get_f32_le();
5480 __struct.q2 = buf.get_f32_le();
5481 __struct.q3 = buf.get_f32_le();
5482 __struct.q4 = buf.get_f32_le();
5483 __struct.rollspeed = buf.get_f32_le();
5484 __struct.pitchspeed = buf.get_f32_le();
5485 __struct.yawspeed = buf.get_f32_le();
5486 for v in &mut __struct.repr_offset_q {
5487 let val = buf.get_f32_le();
5488 *v = val;
5489 }
5490 Ok(__struct)
5491 }
5492 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
5493 let mut __tmp = BytesMut::new(bytes);
5494 #[allow(clippy::absurd_extreme_comparisons)]
5495 #[allow(unused_comparisons)]
5496 if __tmp.remaining() < Self::ENCODED_LEN {
5497 panic!(
5498 "buffer is too small (need {} bytes, but got {})",
5499 Self::ENCODED_LEN,
5500 __tmp.remaining(),
5501 )
5502 }
5503 __tmp.put_u32_le(self.time_boot_ms);
5504 __tmp.put_f32_le(self.q1);
5505 __tmp.put_f32_le(self.q2);
5506 __tmp.put_f32_le(self.q3);
5507 __tmp.put_f32_le(self.q4);
5508 __tmp.put_f32_le(self.rollspeed);
5509 __tmp.put_f32_le(self.pitchspeed);
5510 __tmp.put_f32_le(self.yawspeed);
5511 if matches!(version, MavlinkVersion::V2) {
5512 for val in &self.repr_offset_q {
5513 __tmp.put_f32_le(*val);
5514 }
5515 let len = __tmp.len();
5516 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
5517 } else {
5518 __tmp.len()
5519 }
5520 }
5521}
5522#[doc = "The attitude in the aeronautical frame (right-handed, Z-down, X-front, Y-right), expressed as quaternion. Quaternion order is w, x, y, z and a zero rotation would be expressed as (1 0 0 0)."]
5523#[doc = ""]
5524#[doc = "ID: 61"]
5525#[derive(Debug, Clone, PartialEq)]
5526#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
5527#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
5528#[cfg_attr(feature = "ts", derive(TS))]
5529#[cfg_attr(feature = "ts", ts(export))]
5530pub struct ATTITUDE_QUATERNION_COV_DATA {
5531 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
5532 pub time_usec: u64,
5533 #[doc = "Quaternion components, w, x, y, z (1 0 0 0 is the null-rotation)"]
5534 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
5535 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
5536 pub q: [f32; 4],
5537 #[doc = "Roll angular speed"]
5538 pub rollspeed: f32,
5539 #[doc = "Pitch angular speed"]
5540 pub pitchspeed: f32,
5541 #[doc = "Yaw angular speed"]
5542 pub yawspeed: f32,
5543 #[doc = "Row-major representation of a 3x3 attitude covariance matrix (states: roll, pitch, yaw; first three entries are the first ROW, next three entries are the second row, etc.). If unknown, assign NaN value to first element in the array."]
5544 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
5545 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
5546 pub covariance: [f32; 9],
5547}
5548impl ATTITUDE_QUATERNION_COV_DATA {
5549 pub const ENCODED_LEN: usize = 72usize;
5550 pub const DEFAULT: Self = Self {
5551 time_usec: 0_u64,
5552 q: [0.0_f32; 4usize],
5553 rollspeed: 0.0_f32,
5554 pitchspeed: 0.0_f32,
5555 yawspeed: 0.0_f32,
5556 covariance: [0.0_f32; 9usize],
5557 };
5558 #[cfg(feature = "arbitrary")]
5559 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
5560 use arbitrary::{Arbitrary, Unstructured};
5561 let mut buf = [0u8; 1024];
5562 rng.fill_bytes(&mut buf);
5563 let mut unstructured = Unstructured::new(&buf);
5564 Self::arbitrary(&mut unstructured).unwrap_or_default()
5565 }
5566}
5567impl Default for ATTITUDE_QUATERNION_COV_DATA {
5568 fn default() -> Self {
5569 Self::DEFAULT.clone()
5570 }
5571}
5572impl MessageData for ATTITUDE_QUATERNION_COV_DATA {
5573 type Message = MavMessage;
5574 const ID: u32 = 61u32;
5575 const NAME: &'static str = "ATTITUDE_QUATERNION_COV";
5576 const EXTRA_CRC: u8 = 167u8;
5577 const ENCODED_LEN: usize = 72usize;
5578 fn deser(
5579 _version: MavlinkVersion,
5580 __input: &[u8],
5581 ) -> Result<Self, ::mavlink_core::error::ParserError> {
5582 let avail_len = __input.len();
5583 let mut payload_buf = [0; Self::ENCODED_LEN];
5584 let mut buf = if avail_len < Self::ENCODED_LEN {
5585 payload_buf[0..avail_len].copy_from_slice(__input);
5586 Bytes::new(&payload_buf)
5587 } else {
5588 Bytes::new(__input)
5589 };
5590 let mut __struct = Self::default();
5591 __struct.time_usec = buf.get_u64_le();
5592 for v in &mut __struct.q {
5593 let val = buf.get_f32_le();
5594 *v = val;
5595 }
5596 __struct.rollspeed = buf.get_f32_le();
5597 __struct.pitchspeed = buf.get_f32_le();
5598 __struct.yawspeed = buf.get_f32_le();
5599 for v in &mut __struct.covariance {
5600 let val = buf.get_f32_le();
5601 *v = val;
5602 }
5603 Ok(__struct)
5604 }
5605 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
5606 let mut __tmp = BytesMut::new(bytes);
5607 #[allow(clippy::absurd_extreme_comparisons)]
5608 #[allow(unused_comparisons)]
5609 if __tmp.remaining() < Self::ENCODED_LEN {
5610 panic!(
5611 "buffer is too small (need {} bytes, but got {})",
5612 Self::ENCODED_LEN,
5613 __tmp.remaining(),
5614 )
5615 }
5616 __tmp.put_u64_le(self.time_usec);
5617 for val in &self.q {
5618 __tmp.put_f32_le(*val);
5619 }
5620 __tmp.put_f32_le(self.rollspeed);
5621 __tmp.put_f32_le(self.pitchspeed);
5622 __tmp.put_f32_le(self.yawspeed);
5623 for val in &self.covariance {
5624 __tmp.put_f32_le(*val);
5625 }
5626 if matches!(version, MavlinkVersion::V2) {
5627 let len = __tmp.len();
5628 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
5629 } else {
5630 __tmp.len()
5631 }
5632 }
5633}
5634#[doc = "Reports the current commanded attitude of the vehicle as specified by the autopilot. This should match the commands sent in a SET_ATTITUDE_TARGET message if the vehicle is being controlled this way."]
5635#[doc = ""]
5636#[doc = "ID: 83"]
5637#[derive(Debug, Clone, PartialEq)]
5638#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
5639#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
5640#[cfg_attr(feature = "ts", derive(TS))]
5641#[cfg_attr(feature = "ts", ts(export))]
5642pub struct ATTITUDE_TARGET_DATA {
5643 #[doc = "Timestamp (time since system boot)."]
5644 pub time_boot_ms: u32,
5645 #[doc = "Attitude quaternion (w, x, y, z order, zero-rotation is 1, 0, 0, 0)"]
5646 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
5647 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
5648 pub q: [f32; 4],
5649 #[doc = "Body roll rate"]
5650 pub body_roll_rate: f32,
5651 #[doc = "Body pitch rate"]
5652 pub body_pitch_rate: f32,
5653 #[doc = "Body yaw rate"]
5654 pub body_yaw_rate: f32,
5655 #[doc = "Collective thrust, normalized to 0 .. 1 (-1 .. 1 for vehicles capable of reverse trust)"]
5656 pub thrust: f32,
5657 #[doc = "Bitmap to indicate which dimensions should be ignored by the vehicle."]
5658 pub type_mask: AttitudeTargetTypemask,
5659}
5660impl ATTITUDE_TARGET_DATA {
5661 pub const ENCODED_LEN: usize = 37usize;
5662 pub const DEFAULT: Self = Self {
5663 time_boot_ms: 0_u32,
5664 q: [0.0_f32; 4usize],
5665 body_roll_rate: 0.0_f32,
5666 body_pitch_rate: 0.0_f32,
5667 body_yaw_rate: 0.0_f32,
5668 thrust: 0.0_f32,
5669 type_mask: AttitudeTargetTypemask::DEFAULT,
5670 };
5671 #[cfg(feature = "arbitrary")]
5672 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
5673 use arbitrary::{Arbitrary, Unstructured};
5674 let mut buf = [0u8; 1024];
5675 rng.fill_bytes(&mut buf);
5676 let mut unstructured = Unstructured::new(&buf);
5677 Self::arbitrary(&mut unstructured).unwrap_or_default()
5678 }
5679}
5680impl Default for ATTITUDE_TARGET_DATA {
5681 fn default() -> Self {
5682 Self::DEFAULT.clone()
5683 }
5684}
5685impl MessageData for ATTITUDE_TARGET_DATA {
5686 type Message = MavMessage;
5687 const ID: u32 = 83u32;
5688 const NAME: &'static str = "ATTITUDE_TARGET";
5689 const EXTRA_CRC: u8 = 22u8;
5690 const ENCODED_LEN: usize = 37usize;
5691 fn deser(
5692 _version: MavlinkVersion,
5693 __input: &[u8],
5694 ) -> Result<Self, ::mavlink_core::error::ParserError> {
5695 let avail_len = __input.len();
5696 let mut payload_buf = [0; Self::ENCODED_LEN];
5697 let mut buf = if avail_len < Self::ENCODED_LEN {
5698 payload_buf[0..avail_len].copy_from_slice(__input);
5699 Bytes::new(&payload_buf)
5700 } else {
5701 Bytes::new(__input)
5702 };
5703 let mut __struct = Self::default();
5704 __struct.time_boot_ms = buf.get_u32_le();
5705 for v in &mut __struct.q {
5706 let val = buf.get_f32_le();
5707 *v = val;
5708 }
5709 __struct.body_roll_rate = buf.get_f32_le();
5710 __struct.body_pitch_rate = buf.get_f32_le();
5711 __struct.body_yaw_rate = buf.get_f32_le();
5712 __struct.thrust = buf.get_f32_le();
5713 let tmp = buf.get_u8();
5714 __struct.type_mask =
5715 AttitudeTargetTypemask::from_bits(tmp as <AttitudeTargetTypemask as Flags>::Bits)
5716 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
5717 flag_type: "AttitudeTargetTypemask",
5718 value: tmp as u64,
5719 })?;
5720 Ok(__struct)
5721 }
5722 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
5723 let mut __tmp = BytesMut::new(bytes);
5724 #[allow(clippy::absurd_extreme_comparisons)]
5725 #[allow(unused_comparisons)]
5726 if __tmp.remaining() < Self::ENCODED_LEN {
5727 panic!(
5728 "buffer is too small (need {} bytes, but got {})",
5729 Self::ENCODED_LEN,
5730 __tmp.remaining(),
5731 )
5732 }
5733 __tmp.put_u32_le(self.time_boot_ms);
5734 for val in &self.q {
5735 __tmp.put_f32_le(*val);
5736 }
5737 __tmp.put_f32_le(self.body_roll_rate);
5738 __tmp.put_f32_le(self.body_pitch_rate);
5739 __tmp.put_f32_le(self.body_yaw_rate);
5740 __tmp.put_f32_le(self.thrust);
5741 __tmp.put_u8(self.type_mask.bits() as u8);
5742 if matches!(version, MavlinkVersion::V2) {
5743 let len = __tmp.len();
5744 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
5745 } else {
5746 __tmp.len()
5747 }
5748 }
5749}
5750#[doc = "Motion capture attitude and position."]
5751#[doc = ""]
5752#[doc = "ID: 138"]
5753#[derive(Debug, Clone, PartialEq)]
5754#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
5755#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
5756#[cfg_attr(feature = "ts", derive(TS))]
5757#[cfg_attr(feature = "ts", ts(export))]
5758pub struct ATT_POS_MOCAP_DATA {
5759 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
5760 pub time_usec: u64,
5761 #[doc = "Attitude quaternion (w, x, y, z order, zero-rotation is 1, 0, 0, 0)"]
5762 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
5763 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
5764 pub q: [f32; 4],
5765 #[doc = "X position (NED)"]
5766 pub x: f32,
5767 #[doc = "Y position (NED)"]
5768 pub y: f32,
5769 #[doc = "Z position (NED)"]
5770 pub z: f32,
5771 #[doc = "Row-major representation of a pose 6x6 cross-covariance matrix upper right triangle (states: x, y, z, roll, pitch, yaw; first six entries are the first ROW, next five entries are the second ROW, etc.). If unknown, assign NaN value to first element in the array."]
5772 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
5773 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
5774 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
5775 pub covariance: [f32; 21],
5776}
5777impl ATT_POS_MOCAP_DATA {
5778 pub const ENCODED_LEN: usize = 120usize;
5779 pub const DEFAULT: Self = Self {
5780 time_usec: 0_u64,
5781 q: [0.0_f32; 4usize],
5782 x: 0.0_f32,
5783 y: 0.0_f32,
5784 z: 0.0_f32,
5785 covariance: [0.0_f32; 21usize],
5786 };
5787 #[cfg(feature = "arbitrary")]
5788 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
5789 use arbitrary::{Arbitrary, Unstructured};
5790 let mut buf = [0u8; 1024];
5791 rng.fill_bytes(&mut buf);
5792 let mut unstructured = Unstructured::new(&buf);
5793 Self::arbitrary(&mut unstructured).unwrap_or_default()
5794 }
5795}
5796impl Default for ATT_POS_MOCAP_DATA {
5797 fn default() -> Self {
5798 Self::DEFAULT.clone()
5799 }
5800}
5801impl MessageData for ATT_POS_MOCAP_DATA {
5802 type Message = MavMessage;
5803 const ID: u32 = 138u32;
5804 const NAME: &'static str = "ATT_POS_MOCAP";
5805 const EXTRA_CRC: u8 = 109u8;
5806 const ENCODED_LEN: usize = 120usize;
5807 fn deser(
5808 _version: MavlinkVersion,
5809 __input: &[u8],
5810 ) -> Result<Self, ::mavlink_core::error::ParserError> {
5811 let avail_len = __input.len();
5812 let mut payload_buf = [0; Self::ENCODED_LEN];
5813 let mut buf = if avail_len < Self::ENCODED_LEN {
5814 payload_buf[0..avail_len].copy_from_slice(__input);
5815 Bytes::new(&payload_buf)
5816 } else {
5817 Bytes::new(__input)
5818 };
5819 let mut __struct = Self::default();
5820 __struct.time_usec = buf.get_u64_le();
5821 for v in &mut __struct.q {
5822 let val = buf.get_f32_le();
5823 *v = val;
5824 }
5825 __struct.x = buf.get_f32_le();
5826 __struct.y = buf.get_f32_le();
5827 __struct.z = buf.get_f32_le();
5828 for v in &mut __struct.covariance {
5829 let val = buf.get_f32_le();
5830 *v = val;
5831 }
5832 Ok(__struct)
5833 }
5834 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
5835 let mut __tmp = BytesMut::new(bytes);
5836 #[allow(clippy::absurd_extreme_comparisons)]
5837 #[allow(unused_comparisons)]
5838 if __tmp.remaining() < Self::ENCODED_LEN {
5839 panic!(
5840 "buffer is too small (need {} bytes, but got {})",
5841 Self::ENCODED_LEN,
5842 __tmp.remaining(),
5843 )
5844 }
5845 __tmp.put_u64_le(self.time_usec);
5846 for val in &self.q {
5847 __tmp.put_f32_le(*val);
5848 }
5849 __tmp.put_f32_le(self.x);
5850 __tmp.put_f32_le(self.y);
5851 __tmp.put_f32_le(self.z);
5852 if matches!(version, MavlinkVersion::V2) {
5853 for val in &self.covariance {
5854 __tmp.put_f32_le(*val);
5855 }
5856 let len = __tmp.len();
5857 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
5858 } else {
5859 __tmp.len()
5860 }
5861 }
5862}
5863#[doc = "Emit an encrypted signature / key identifying this system. PLEASE NOTE: This protocol has been kept simple, so transmitting the key requires an encrypted channel for true safety."]
5864#[doc = ""]
5865#[doc = "ID: 7"]
5866#[derive(Debug, Clone, PartialEq)]
5867#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
5868#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
5869#[cfg_attr(feature = "ts", derive(TS))]
5870#[cfg_attr(feature = "ts", ts(export))]
5871pub struct AUTH_KEY_DATA {
5872 #[doc = "key"]
5873 #[cfg_attr(feature = "ts", ts(type = "string"))]
5874 pub key: CharArray<32>,
5875}
5876impl AUTH_KEY_DATA {
5877 pub const ENCODED_LEN: usize = 32usize;
5878 pub const DEFAULT: Self = Self {
5879 key: CharArray::new([0_u8; 32usize]),
5880 };
5881 #[cfg(feature = "arbitrary")]
5882 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
5883 use arbitrary::{Arbitrary, Unstructured};
5884 let mut buf = [0u8; 1024];
5885 rng.fill_bytes(&mut buf);
5886 let mut unstructured = Unstructured::new(&buf);
5887 Self::arbitrary(&mut unstructured).unwrap_or_default()
5888 }
5889}
5890impl Default for AUTH_KEY_DATA {
5891 fn default() -> Self {
5892 Self::DEFAULT.clone()
5893 }
5894}
5895impl MessageData for AUTH_KEY_DATA {
5896 type Message = MavMessage;
5897 const ID: u32 = 7u32;
5898 const NAME: &'static str = "AUTH_KEY";
5899 const EXTRA_CRC: u8 = 119u8;
5900 const ENCODED_LEN: usize = 32usize;
5901 fn deser(
5902 _version: MavlinkVersion,
5903 __input: &[u8],
5904 ) -> Result<Self, ::mavlink_core::error::ParserError> {
5905 let avail_len = __input.len();
5906 let mut payload_buf = [0; Self::ENCODED_LEN];
5907 let mut buf = if avail_len < Self::ENCODED_LEN {
5908 payload_buf[0..avail_len].copy_from_slice(__input);
5909 Bytes::new(&payload_buf)
5910 } else {
5911 Bytes::new(__input)
5912 };
5913 let mut __struct = Self::default();
5914 let mut tmp = [0_u8; 32usize];
5915 for v in &mut tmp {
5916 *v = buf.get_u8();
5917 }
5918 __struct.key = CharArray::new(tmp);
5919 Ok(__struct)
5920 }
5921 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
5922 let mut __tmp = BytesMut::new(bytes);
5923 #[allow(clippy::absurd_extreme_comparisons)]
5924 #[allow(unused_comparisons)]
5925 if __tmp.remaining() < Self::ENCODED_LEN {
5926 panic!(
5927 "buffer is too small (need {} bytes, but got {})",
5928 Self::ENCODED_LEN,
5929 __tmp.remaining(),
5930 )
5931 }
5932 for val in &self.key {
5933 __tmp.put_u8(*val);
5934 }
5935 if matches!(version, MavlinkVersion::V2) {
5936 let len = __tmp.len();
5937 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
5938 } else {
5939 __tmp.len()
5940 }
5941 }
5942}
5943#[doc = "Low level message containing autopilot state relevant for a gimbal device. This message is to be sent from the autopilot to the gimbal device component. The data of this message are for the gimbal device's estimator corrections, in particular horizon compensation, as well as indicates autopilot control intentions, e.g. feed forward angular control in the z-axis."]
5944#[doc = ""]
5945#[doc = "ID: 286"]
5946#[derive(Debug, Clone, PartialEq)]
5947#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
5948#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
5949#[cfg_attr(feature = "ts", derive(TS))]
5950#[cfg_attr(feature = "ts", ts(export))]
5951pub struct AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA {
5952 #[doc = "Timestamp (time since system boot)."]
5953 pub time_boot_us: u64,
5954 #[doc = "Quaternion components of autopilot attitude: w, x, y, z (1 0 0 0 is the null-rotation, Hamilton convention)."]
5955 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
5956 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
5957 pub q: [f32; 4],
5958 #[doc = "Estimated delay of the attitude data. 0 if unknown."]
5959 pub q_estimated_delay_us: u32,
5960 #[doc = "X Speed in NED (North, East, Down). NAN if unknown."]
5961 pub vx: f32,
5962 #[doc = "Y Speed in NED (North, East, Down). NAN if unknown."]
5963 pub vy: f32,
5964 #[doc = "Z Speed in NED (North, East, Down). NAN if unknown."]
5965 pub vz: f32,
5966 #[doc = "Estimated delay of the speed data. 0 if unknown."]
5967 pub v_estimated_delay_us: u32,
5968 #[doc = "Feed forward Z component of angular velocity (positive: yawing to the right). NaN to be ignored. This is to indicate if the autopilot is actively yawing."]
5969 pub feed_forward_angular_velocity_z: f32,
5970 #[doc = "Bitmap indicating which estimator outputs are valid."]
5971 pub estimator_status: EstimatorStatusFlags,
5972 #[doc = "System ID"]
5973 pub target_system: u8,
5974 #[doc = "Component ID"]
5975 pub target_component: u8,
5976 #[doc = "The landed state. Is set to MAV_LANDED_STATE_UNDEFINED if landed state is unknown."]
5977 pub landed_state: MavLandedState,
5978 #[doc = "Z component of angular velocity in NED (North, East, Down). NaN if unknown."]
5979 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
5980 pub angular_velocity_z: f32,
5981}
5982impl AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA {
5983 pub const ENCODED_LEN: usize = 57usize;
5984 pub const DEFAULT: Self = Self {
5985 time_boot_us: 0_u64,
5986 q: [0.0_f32; 4usize],
5987 q_estimated_delay_us: 0_u32,
5988 vx: 0.0_f32,
5989 vy: 0.0_f32,
5990 vz: 0.0_f32,
5991 v_estimated_delay_us: 0_u32,
5992 feed_forward_angular_velocity_z: 0.0_f32,
5993 estimator_status: EstimatorStatusFlags::DEFAULT,
5994 target_system: 0_u8,
5995 target_component: 0_u8,
5996 landed_state: MavLandedState::DEFAULT,
5997 angular_velocity_z: 0.0_f32,
5998 };
5999 #[cfg(feature = "arbitrary")]
6000 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
6001 use arbitrary::{Arbitrary, Unstructured};
6002 let mut buf = [0u8; 1024];
6003 rng.fill_bytes(&mut buf);
6004 let mut unstructured = Unstructured::new(&buf);
6005 Self::arbitrary(&mut unstructured).unwrap_or_default()
6006 }
6007}
6008impl Default for AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA {
6009 fn default() -> Self {
6010 Self::DEFAULT.clone()
6011 }
6012}
6013impl MessageData for AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA {
6014 type Message = MavMessage;
6015 const ID: u32 = 286u32;
6016 const NAME: &'static str = "AUTOPILOT_STATE_FOR_GIMBAL_DEVICE";
6017 const EXTRA_CRC: u8 = 210u8;
6018 const ENCODED_LEN: usize = 57usize;
6019 fn deser(
6020 _version: MavlinkVersion,
6021 __input: &[u8],
6022 ) -> Result<Self, ::mavlink_core::error::ParserError> {
6023 let avail_len = __input.len();
6024 let mut payload_buf = [0; Self::ENCODED_LEN];
6025 let mut buf = if avail_len < Self::ENCODED_LEN {
6026 payload_buf[0..avail_len].copy_from_slice(__input);
6027 Bytes::new(&payload_buf)
6028 } else {
6029 Bytes::new(__input)
6030 };
6031 let mut __struct = Self::default();
6032 __struct.time_boot_us = buf.get_u64_le();
6033 for v in &mut __struct.q {
6034 let val = buf.get_f32_le();
6035 *v = val;
6036 }
6037 __struct.q_estimated_delay_us = buf.get_u32_le();
6038 __struct.vx = buf.get_f32_le();
6039 __struct.vy = buf.get_f32_le();
6040 __struct.vz = buf.get_f32_le();
6041 __struct.v_estimated_delay_us = buf.get_u32_le();
6042 __struct.feed_forward_angular_velocity_z = buf.get_f32_le();
6043 let tmp = buf.get_u16_le();
6044 __struct.estimator_status = EstimatorStatusFlags::from_bits(
6045 tmp as <EstimatorStatusFlags as Flags>::Bits,
6046 )
6047 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
6048 flag_type: "EstimatorStatusFlags",
6049 value: tmp as u64,
6050 })?;
6051 __struct.target_system = buf.get_u8();
6052 __struct.target_component = buf.get_u8();
6053 let tmp = buf.get_u8();
6054 __struct.landed_state =
6055 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
6056 enum_type: "MavLandedState",
6057 value: tmp as u64,
6058 })?;
6059 __struct.angular_velocity_z = buf.get_f32_le();
6060 Ok(__struct)
6061 }
6062 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
6063 let mut __tmp = BytesMut::new(bytes);
6064 #[allow(clippy::absurd_extreme_comparisons)]
6065 #[allow(unused_comparisons)]
6066 if __tmp.remaining() < Self::ENCODED_LEN {
6067 panic!(
6068 "buffer is too small (need {} bytes, but got {})",
6069 Self::ENCODED_LEN,
6070 __tmp.remaining(),
6071 )
6072 }
6073 __tmp.put_u64_le(self.time_boot_us);
6074 for val in &self.q {
6075 __tmp.put_f32_le(*val);
6076 }
6077 __tmp.put_u32_le(self.q_estimated_delay_us);
6078 __tmp.put_f32_le(self.vx);
6079 __tmp.put_f32_le(self.vy);
6080 __tmp.put_f32_le(self.vz);
6081 __tmp.put_u32_le(self.v_estimated_delay_us);
6082 __tmp.put_f32_le(self.feed_forward_angular_velocity_z);
6083 __tmp.put_u16_le(self.estimator_status.bits() as u16);
6084 __tmp.put_u8(self.target_system);
6085 __tmp.put_u8(self.target_component);
6086 __tmp.put_u8(self.landed_state as u8);
6087 if matches!(version, MavlinkVersion::V2) {
6088 __tmp.put_f32_le(self.angular_velocity_z);
6089 let len = __tmp.len();
6090 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
6091 } else {
6092 __tmp.len()
6093 }
6094 }
6095}
6096#[doc = "Version and capability of autopilot software. This should be emitted in response to a request with MAV_CMD_REQUEST_MESSAGE."]
6097#[doc = ""]
6098#[doc = "ID: 148"]
6099#[derive(Debug, Clone, PartialEq)]
6100#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
6101#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
6102#[cfg_attr(feature = "ts", derive(TS))]
6103#[cfg_attr(feature = "ts", ts(export))]
6104pub struct AUTOPILOT_VERSION_DATA {
6105 #[doc = "Bitmap of capabilities"]
6106 pub capabilities: MavProtocolCapability,
6107 #[doc = "UID if provided by hardware (see uid2)"]
6108 pub uid: u64,
6109 #[doc = "Firmware version number. The field must be encoded as 4 bytes, where each byte (shown from MSB to LSB) is part of a semantic version: (major) (minor) (patch) (FIRMWARE_VERSION_TYPE)."]
6110 pub flight_sw_version: u32,
6111 #[doc = "Middleware version number"]
6112 pub middleware_sw_version: u32,
6113 #[doc = "Operating system version number"]
6114 pub os_sw_version: u32,
6115 #[doc = "HW / board version (last 8 bits should be silicon ID, if any). The first 16 bits of this field specify <https://github.com/PX4/PX4-Bootloader/blob/master/board_types.txt>"]
6116 pub board_version: u32,
6117 #[doc = "ID of the board vendor"]
6118 pub vendor_id: u16,
6119 #[doc = "ID of the product"]
6120 pub product_id: u16,
6121 #[doc = "Custom version field, commonly the first 8 bytes of the git hash. This is not an unique identifier, but should allow to identify the commit using the main version number even for very large code bases."]
6122 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
6123 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
6124 pub flight_custom_version: [u8; 8],
6125 #[doc = "Custom version field, commonly the first 8 bytes of the git hash. This is not an unique identifier, but should allow to identify the commit using the main version number even for very large code bases."]
6126 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
6127 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
6128 pub middleware_custom_version: [u8; 8],
6129 #[doc = "Custom version field, commonly the first 8 bytes of the git hash. This is not an unique identifier, but should allow to identify the commit using the main version number even for very large code bases."]
6130 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
6131 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
6132 pub os_custom_version: [u8; 8],
6133 #[doc = "UID if provided by hardware (supersedes the uid field. If this is non-zero, use this field, otherwise use uid)"]
6134 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
6135 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
6136 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
6137 pub uid2: [u8; 18],
6138}
6139impl AUTOPILOT_VERSION_DATA {
6140 pub const ENCODED_LEN: usize = 78usize;
6141 pub const DEFAULT: Self = Self {
6142 capabilities: MavProtocolCapability::DEFAULT,
6143 uid: 0_u64,
6144 flight_sw_version: 0_u32,
6145 middleware_sw_version: 0_u32,
6146 os_sw_version: 0_u32,
6147 board_version: 0_u32,
6148 vendor_id: 0_u16,
6149 product_id: 0_u16,
6150 flight_custom_version: [0_u8; 8usize],
6151 middleware_custom_version: [0_u8; 8usize],
6152 os_custom_version: [0_u8; 8usize],
6153 uid2: [0_u8; 18usize],
6154 };
6155 #[cfg(feature = "arbitrary")]
6156 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
6157 use arbitrary::{Arbitrary, Unstructured};
6158 let mut buf = [0u8; 1024];
6159 rng.fill_bytes(&mut buf);
6160 let mut unstructured = Unstructured::new(&buf);
6161 Self::arbitrary(&mut unstructured).unwrap_or_default()
6162 }
6163}
6164impl Default for AUTOPILOT_VERSION_DATA {
6165 fn default() -> Self {
6166 Self::DEFAULT.clone()
6167 }
6168}
6169impl MessageData for AUTOPILOT_VERSION_DATA {
6170 type Message = MavMessage;
6171 const ID: u32 = 148u32;
6172 const NAME: &'static str = "AUTOPILOT_VERSION";
6173 const EXTRA_CRC: u8 = 178u8;
6174 const ENCODED_LEN: usize = 78usize;
6175 fn deser(
6176 _version: MavlinkVersion,
6177 __input: &[u8],
6178 ) -> Result<Self, ::mavlink_core::error::ParserError> {
6179 let avail_len = __input.len();
6180 let mut payload_buf = [0; Self::ENCODED_LEN];
6181 let mut buf = if avail_len < Self::ENCODED_LEN {
6182 payload_buf[0..avail_len].copy_from_slice(__input);
6183 Bytes::new(&payload_buf)
6184 } else {
6185 Bytes::new(__input)
6186 };
6187 let mut __struct = Self::default();
6188 let tmp = buf.get_u64_le();
6189 __struct.capabilities = MavProtocolCapability::from_bits(
6190 tmp as <MavProtocolCapability as Flags>::Bits,
6191 )
6192 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
6193 flag_type: "MavProtocolCapability",
6194 value: tmp as u64,
6195 })?;
6196 __struct.uid = buf.get_u64_le();
6197 __struct.flight_sw_version = buf.get_u32_le();
6198 __struct.middleware_sw_version = buf.get_u32_le();
6199 __struct.os_sw_version = buf.get_u32_le();
6200 __struct.board_version = buf.get_u32_le();
6201 __struct.vendor_id = buf.get_u16_le();
6202 __struct.product_id = buf.get_u16_le();
6203 for v in &mut __struct.flight_custom_version {
6204 let val = buf.get_u8();
6205 *v = val;
6206 }
6207 for v in &mut __struct.middleware_custom_version {
6208 let val = buf.get_u8();
6209 *v = val;
6210 }
6211 for v in &mut __struct.os_custom_version {
6212 let val = buf.get_u8();
6213 *v = val;
6214 }
6215 for v in &mut __struct.uid2 {
6216 let val = buf.get_u8();
6217 *v = val;
6218 }
6219 Ok(__struct)
6220 }
6221 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
6222 let mut __tmp = BytesMut::new(bytes);
6223 #[allow(clippy::absurd_extreme_comparisons)]
6224 #[allow(unused_comparisons)]
6225 if __tmp.remaining() < Self::ENCODED_LEN {
6226 panic!(
6227 "buffer is too small (need {} bytes, but got {})",
6228 Self::ENCODED_LEN,
6229 __tmp.remaining(),
6230 )
6231 }
6232 __tmp.put_u64_le(self.capabilities.bits() as u64);
6233 __tmp.put_u64_le(self.uid);
6234 __tmp.put_u32_le(self.flight_sw_version);
6235 __tmp.put_u32_le(self.middleware_sw_version);
6236 __tmp.put_u32_le(self.os_sw_version);
6237 __tmp.put_u32_le(self.board_version);
6238 __tmp.put_u16_le(self.vendor_id);
6239 __tmp.put_u16_le(self.product_id);
6240 for val in &self.flight_custom_version {
6241 __tmp.put_u8(*val);
6242 }
6243 for val in &self.middleware_custom_version {
6244 __tmp.put_u8(*val);
6245 }
6246 for val in &self.os_custom_version {
6247 __tmp.put_u8(*val);
6248 }
6249 if matches!(version, MavlinkVersion::V2) {
6250 for val in &self.uid2 {
6251 __tmp.put_u8(*val);
6252 }
6253 let len = __tmp.len();
6254 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
6255 } else {
6256 __tmp.len()
6257 }
6258 }
6259}
6260#[doc = "Information about a flight mode. The message can be enumerated to get information for all modes, or requested for a particular mode, using MAV_CMD_REQUEST_MESSAGE. Specify 0 in param2 to request that the message is emitted for all available modes or the specific index for just one mode. The modes must be available/settable for the current vehicle/frame type. Each mode should only be emitted once (even if it is both standard and custom). Note that the current mode should be emitted in CURRENT_MODE, and that if the mode list can change then AVAILABLE_MODES_MONITOR must be emitted on first change and subsequently streamed. See <https://mavlink.io/en/services/standard_modes.html>."]
6261#[doc = ""]
6262#[doc = "ID: 435"]
6263#[derive(Debug, Clone, PartialEq)]
6264#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
6265#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
6266#[cfg_attr(feature = "ts", derive(TS))]
6267#[cfg_attr(feature = "ts", ts(export))]
6268pub struct AVAILABLE_MODES_DATA {
6269 #[doc = "A bitfield for use for autopilot-specific flags"]
6270 pub custom_mode: u32,
6271 #[doc = "Mode properties."]
6272 pub properties: MavModeProperty,
6273 #[doc = "The total number of available modes for the current vehicle type."]
6274 pub number_modes: u8,
6275 #[doc = "The current mode index within number_modes, indexed from 1. The index is not guaranteed to be persistent, and may change between reboots or if the set of modes change."]
6276 pub mode_index: u8,
6277 #[doc = "Standard mode."]
6278 pub standard_mode: MavStandardMode,
6279 #[doc = "Name of custom mode, with null termination character. Should be omitted for standard modes."]
6280 #[cfg_attr(feature = "ts", ts(type = "string"))]
6281 pub mode_name: CharArray<35>,
6282}
6283impl AVAILABLE_MODES_DATA {
6284 pub const ENCODED_LEN: usize = 46usize;
6285 pub const DEFAULT: Self = Self {
6286 custom_mode: 0_u32,
6287 properties: MavModeProperty::DEFAULT,
6288 number_modes: 0_u8,
6289 mode_index: 0_u8,
6290 standard_mode: MavStandardMode::DEFAULT,
6291 mode_name: CharArray::new([0_u8; 35usize]),
6292 };
6293 #[cfg(feature = "arbitrary")]
6294 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
6295 use arbitrary::{Arbitrary, Unstructured};
6296 let mut buf = [0u8; 1024];
6297 rng.fill_bytes(&mut buf);
6298 let mut unstructured = Unstructured::new(&buf);
6299 Self::arbitrary(&mut unstructured).unwrap_or_default()
6300 }
6301}
6302impl Default for AVAILABLE_MODES_DATA {
6303 fn default() -> Self {
6304 Self::DEFAULT.clone()
6305 }
6306}
6307impl MessageData for AVAILABLE_MODES_DATA {
6308 type Message = MavMessage;
6309 const ID: u32 = 435u32;
6310 const NAME: &'static str = "AVAILABLE_MODES";
6311 const EXTRA_CRC: u8 = 134u8;
6312 const ENCODED_LEN: usize = 46usize;
6313 fn deser(
6314 _version: MavlinkVersion,
6315 __input: &[u8],
6316 ) -> Result<Self, ::mavlink_core::error::ParserError> {
6317 let avail_len = __input.len();
6318 let mut payload_buf = [0; Self::ENCODED_LEN];
6319 let mut buf = if avail_len < Self::ENCODED_LEN {
6320 payload_buf[0..avail_len].copy_from_slice(__input);
6321 Bytes::new(&payload_buf)
6322 } else {
6323 Bytes::new(__input)
6324 };
6325 let mut __struct = Self::default();
6326 __struct.custom_mode = buf.get_u32_le();
6327 let tmp = buf.get_u32_le();
6328 __struct.properties = MavModeProperty::from_bits(tmp as <MavModeProperty as Flags>::Bits)
6329 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
6330 flag_type: "MavModeProperty",
6331 value: tmp as u64,
6332 })?;
6333 __struct.number_modes = buf.get_u8();
6334 __struct.mode_index = buf.get_u8();
6335 let tmp = buf.get_u8();
6336 __struct.standard_mode =
6337 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
6338 enum_type: "MavStandardMode",
6339 value: tmp as u64,
6340 })?;
6341 let mut tmp = [0_u8; 35usize];
6342 for v in &mut tmp {
6343 *v = buf.get_u8();
6344 }
6345 __struct.mode_name = CharArray::new(tmp);
6346 Ok(__struct)
6347 }
6348 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
6349 let mut __tmp = BytesMut::new(bytes);
6350 #[allow(clippy::absurd_extreme_comparisons)]
6351 #[allow(unused_comparisons)]
6352 if __tmp.remaining() < Self::ENCODED_LEN {
6353 panic!(
6354 "buffer is too small (need {} bytes, but got {})",
6355 Self::ENCODED_LEN,
6356 __tmp.remaining(),
6357 )
6358 }
6359 __tmp.put_u32_le(self.custom_mode);
6360 __tmp.put_u32_le(self.properties.bits() as u32);
6361 __tmp.put_u8(self.number_modes);
6362 __tmp.put_u8(self.mode_index);
6363 __tmp.put_u8(self.standard_mode as u8);
6364 for val in &self.mode_name {
6365 __tmp.put_u8(*val);
6366 }
6367 if matches!(version, MavlinkVersion::V2) {
6368 let len = __tmp.len();
6369 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
6370 } else {
6371 __tmp.len()
6372 }
6373 }
6374}
6375#[doc = "A change to the sequence number indicates that the set of AVAILABLE_MODES has changed. A receiver must re-request all available modes whenever the sequence number changes. This is only emitted after the first change and should then be broadcast at low rate (nominally 0.3 Hz) and on change. See <https://mavlink.io/en/services/standard_modes.html>."]
6376#[doc = ""]
6377#[doc = "ID: 437"]
6378#[derive(Debug, Clone, PartialEq)]
6379#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
6380#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
6381#[cfg_attr(feature = "ts", derive(TS))]
6382#[cfg_attr(feature = "ts", ts(export))]
6383pub struct AVAILABLE_MODES_MONITOR_DATA {
6384 #[doc = "Sequence number. The value iterates sequentially whenever AVAILABLE_MODES changes (e.g. support for a new mode is added/removed dynamically)."]
6385 pub seq: u8,
6386}
6387impl AVAILABLE_MODES_MONITOR_DATA {
6388 pub const ENCODED_LEN: usize = 1usize;
6389 pub const DEFAULT: Self = Self { seq: 0_u8 };
6390 #[cfg(feature = "arbitrary")]
6391 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
6392 use arbitrary::{Arbitrary, Unstructured};
6393 let mut buf = [0u8; 1024];
6394 rng.fill_bytes(&mut buf);
6395 let mut unstructured = Unstructured::new(&buf);
6396 Self::arbitrary(&mut unstructured).unwrap_or_default()
6397 }
6398}
6399impl Default for AVAILABLE_MODES_MONITOR_DATA {
6400 fn default() -> Self {
6401 Self::DEFAULT.clone()
6402 }
6403}
6404impl MessageData for AVAILABLE_MODES_MONITOR_DATA {
6405 type Message = MavMessage;
6406 const ID: u32 = 437u32;
6407 const NAME: &'static str = "AVAILABLE_MODES_MONITOR";
6408 const EXTRA_CRC: u8 = 30u8;
6409 const ENCODED_LEN: usize = 1usize;
6410 fn deser(
6411 _version: MavlinkVersion,
6412 __input: &[u8],
6413 ) -> Result<Self, ::mavlink_core::error::ParserError> {
6414 let avail_len = __input.len();
6415 let mut payload_buf = [0; Self::ENCODED_LEN];
6416 let mut buf = if avail_len < Self::ENCODED_LEN {
6417 payload_buf[0..avail_len].copy_from_slice(__input);
6418 Bytes::new(&payload_buf)
6419 } else {
6420 Bytes::new(__input)
6421 };
6422 let mut __struct = Self::default();
6423 __struct.seq = buf.get_u8();
6424 Ok(__struct)
6425 }
6426 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
6427 let mut __tmp = BytesMut::new(bytes);
6428 #[allow(clippy::absurd_extreme_comparisons)]
6429 #[allow(unused_comparisons)]
6430 if __tmp.remaining() < Self::ENCODED_LEN {
6431 panic!(
6432 "buffer is too small (need {} bytes, but got {})",
6433 Self::ENCODED_LEN,
6434 __tmp.remaining(),
6435 )
6436 }
6437 __tmp.put_u8(self.seq);
6438 if matches!(version, MavlinkVersion::V2) {
6439 let len = __tmp.len();
6440 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
6441 } else {
6442 __tmp.len()
6443 }
6444 }
6445}
6446#[doc = "Battery information that is static, or requires infrequent update. This message should requested using MAV_CMD_REQUEST_MESSAGE and/or streamed at very low rate. BATTERY_STATUS_V2 is used for higher-rate battery status information."]
6447#[doc = ""]
6448#[doc = "ID: 372"]
6449#[derive(Debug, Clone, PartialEq)]
6450#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
6451#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
6452#[cfg_attr(feature = "ts", derive(TS))]
6453#[cfg_attr(feature = "ts", ts(export))]
6454pub struct BATTERY_INFO_DATA {
6455 #[doc = "Minimum per-cell voltage when discharging. 0: field not provided."]
6456 pub discharge_minimum_voltage: f32,
6457 #[doc = "Minimum per-cell voltage when charging. 0: field not provided."]
6458 pub charging_minimum_voltage: f32,
6459 #[doc = "Minimum per-cell voltage when resting. 0: field not provided."]
6460 pub resting_minimum_voltage: f32,
6461 #[doc = "Maximum per-cell voltage when charged. 0: field not provided."]
6462 pub charging_maximum_voltage: f32,
6463 #[doc = "Maximum pack continuous charge current. 0: field not provided."]
6464 pub charging_maximum_current: f32,
6465 #[doc = "Battery nominal voltage. Used for conversion between Wh and Ah. 0: field not provided."]
6466 pub nominal_voltage: f32,
6467 #[doc = "Maximum pack discharge current. 0: field not provided."]
6468 pub discharge_maximum_current: f32,
6469 #[doc = "Maximum pack discharge burst current. 0: field not provided."]
6470 pub discharge_maximum_burst_current: f32,
6471 #[doc = "Fully charged design capacity. 0: field not provided."]
6472 pub design_capacity: f32,
6473 #[doc = "Predicted battery capacity when fully charged (accounting for battery degradation). NAN: field not provided."]
6474 pub full_charge_capacity: f32,
6475 #[doc = "Lifetime count of the number of charge/discharge cycles (<https://en.wikipedia.org/wiki/Charge_cycle>). UINT16_MAX: field not provided."]
6476 pub cycle_count: u16,
6477 #[doc = "Battery weight. 0: field not provided."]
6478 pub weight: u16,
6479 #[doc = "Battery ID"]
6480 pub id: u8,
6481 #[doc = "Function of the battery."]
6482 pub battery_function: MavBatteryFunction,
6483 #[doc = "Type (chemistry) of the battery."]
6484 pub mavtype: MavBatteryType,
6485 #[doc = "State of Health (SOH) estimate. Typically 100% at the time of manufacture and will decrease over time and use. -1: field not provided."]
6486 pub state_of_health: u8,
6487 #[doc = "Number of battery cells in series. 0: field not provided."]
6488 pub cells_in_series: u8,
6489 #[doc = "Manufacture date (DDMMYYYY) in ASCII characters, 0 terminated. All 0: field not provided."]
6490 #[cfg_attr(feature = "ts", ts(type = "string"))]
6491 pub manufacture_date: CharArray<9>,
6492 #[doc = "Serial number in ASCII characters, 0 terminated. All 0: field not provided."]
6493 #[cfg_attr(feature = "ts", ts(type = "string"))]
6494 pub serial_number: CharArray<32>,
6495 #[doc = "Battery device name. Formatted as manufacturer name then product name, separated with an underscore (in ASCII characters), 0 terminated. All 0: field not provided."]
6496 #[cfg_attr(feature = "ts", ts(type = "string"))]
6497 pub name: CharArray<50>,
6498}
6499impl BATTERY_INFO_DATA {
6500 pub const ENCODED_LEN: usize = 140usize;
6501 pub const DEFAULT: Self = Self {
6502 discharge_minimum_voltage: 0.0_f32,
6503 charging_minimum_voltage: 0.0_f32,
6504 resting_minimum_voltage: 0.0_f32,
6505 charging_maximum_voltage: 0.0_f32,
6506 charging_maximum_current: 0.0_f32,
6507 nominal_voltage: 0.0_f32,
6508 discharge_maximum_current: 0.0_f32,
6509 discharge_maximum_burst_current: 0.0_f32,
6510 design_capacity: 0.0_f32,
6511 full_charge_capacity: 0.0_f32,
6512 cycle_count: 0_u16,
6513 weight: 0_u16,
6514 id: 0_u8,
6515 battery_function: MavBatteryFunction::DEFAULT,
6516 mavtype: MavBatteryType::DEFAULT,
6517 state_of_health: 0_u8,
6518 cells_in_series: 0_u8,
6519 manufacture_date: CharArray::new([0_u8; 9usize]),
6520 serial_number: CharArray::new([0_u8; 32usize]),
6521 name: CharArray::new([0_u8; 50usize]),
6522 };
6523 #[cfg(feature = "arbitrary")]
6524 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
6525 use arbitrary::{Arbitrary, Unstructured};
6526 let mut buf = [0u8; 1024];
6527 rng.fill_bytes(&mut buf);
6528 let mut unstructured = Unstructured::new(&buf);
6529 Self::arbitrary(&mut unstructured).unwrap_or_default()
6530 }
6531}
6532impl Default for BATTERY_INFO_DATA {
6533 fn default() -> Self {
6534 Self::DEFAULT.clone()
6535 }
6536}
6537impl MessageData for BATTERY_INFO_DATA {
6538 type Message = MavMessage;
6539 const ID: u32 = 372u32;
6540 const NAME: &'static str = "BATTERY_INFO";
6541 const EXTRA_CRC: u8 = 26u8;
6542 const ENCODED_LEN: usize = 140usize;
6543 fn deser(
6544 _version: MavlinkVersion,
6545 __input: &[u8],
6546 ) -> Result<Self, ::mavlink_core::error::ParserError> {
6547 let avail_len = __input.len();
6548 let mut payload_buf = [0; Self::ENCODED_LEN];
6549 let mut buf = if avail_len < Self::ENCODED_LEN {
6550 payload_buf[0..avail_len].copy_from_slice(__input);
6551 Bytes::new(&payload_buf)
6552 } else {
6553 Bytes::new(__input)
6554 };
6555 let mut __struct = Self::default();
6556 __struct.discharge_minimum_voltage = buf.get_f32_le();
6557 __struct.charging_minimum_voltage = buf.get_f32_le();
6558 __struct.resting_minimum_voltage = buf.get_f32_le();
6559 __struct.charging_maximum_voltage = buf.get_f32_le();
6560 __struct.charging_maximum_current = buf.get_f32_le();
6561 __struct.nominal_voltage = buf.get_f32_le();
6562 __struct.discharge_maximum_current = buf.get_f32_le();
6563 __struct.discharge_maximum_burst_current = buf.get_f32_le();
6564 __struct.design_capacity = buf.get_f32_le();
6565 __struct.full_charge_capacity = buf.get_f32_le();
6566 __struct.cycle_count = buf.get_u16_le();
6567 __struct.weight = buf.get_u16_le();
6568 __struct.id = buf.get_u8();
6569 let tmp = buf.get_u8();
6570 __struct.battery_function =
6571 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
6572 enum_type: "MavBatteryFunction",
6573 value: tmp as u64,
6574 })?;
6575 let tmp = buf.get_u8();
6576 __struct.mavtype =
6577 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
6578 enum_type: "MavBatteryType",
6579 value: tmp as u64,
6580 })?;
6581 __struct.state_of_health = buf.get_u8();
6582 __struct.cells_in_series = buf.get_u8();
6583 let mut tmp = [0_u8; 9usize];
6584 for v in &mut tmp {
6585 *v = buf.get_u8();
6586 }
6587 __struct.manufacture_date = CharArray::new(tmp);
6588 let mut tmp = [0_u8; 32usize];
6589 for v in &mut tmp {
6590 *v = buf.get_u8();
6591 }
6592 __struct.serial_number = CharArray::new(tmp);
6593 let mut tmp = [0_u8; 50usize];
6594 for v in &mut tmp {
6595 *v = buf.get_u8();
6596 }
6597 __struct.name = CharArray::new(tmp);
6598 Ok(__struct)
6599 }
6600 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
6601 let mut __tmp = BytesMut::new(bytes);
6602 #[allow(clippy::absurd_extreme_comparisons)]
6603 #[allow(unused_comparisons)]
6604 if __tmp.remaining() < Self::ENCODED_LEN {
6605 panic!(
6606 "buffer is too small (need {} bytes, but got {})",
6607 Self::ENCODED_LEN,
6608 __tmp.remaining(),
6609 )
6610 }
6611 __tmp.put_f32_le(self.discharge_minimum_voltage);
6612 __tmp.put_f32_le(self.charging_minimum_voltage);
6613 __tmp.put_f32_le(self.resting_minimum_voltage);
6614 __tmp.put_f32_le(self.charging_maximum_voltage);
6615 __tmp.put_f32_le(self.charging_maximum_current);
6616 __tmp.put_f32_le(self.nominal_voltage);
6617 __tmp.put_f32_le(self.discharge_maximum_current);
6618 __tmp.put_f32_le(self.discharge_maximum_burst_current);
6619 __tmp.put_f32_le(self.design_capacity);
6620 __tmp.put_f32_le(self.full_charge_capacity);
6621 __tmp.put_u16_le(self.cycle_count);
6622 __tmp.put_u16_le(self.weight);
6623 __tmp.put_u8(self.id);
6624 __tmp.put_u8(self.battery_function as u8);
6625 __tmp.put_u8(self.mavtype as u8);
6626 __tmp.put_u8(self.state_of_health);
6627 __tmp.put_u8(self.cells_in_series);
6628 for val in &self.manufacture_date {
6629 __tmp.put_u8(*val);
6630 }
6631 for val in &self.serial_number {
6632 __tmp.put_u8(*val);
6633 }
6634 for val in &self.name {
6635 __tmp.put_u8(*val);
6636 }
6637 if matches!(version, MavlinkVersion::V2) {
6638 let len = __tmp.len();
6639 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
6640 } else {
6641 __tmp.len()
6642 }
6643 }
6644}
6645#[doc = "Battery information. Updates GCS with flight controller battery status. Smart batteries also use this message, but may additionally send BATTERY_INFO."]
6646#[doc = ""]
6647#[doc = "ID: 147"]
6648#[derive(Debug, Clone, PartialEq)]
6649#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
6650#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
6651#[cfg_attr(feature = "ts", derive(TS))]
6652#[cfg_attr(feature = "ts", ts(export))]
6653pub struct BATTERY_STATUS_DATA {
6654 #[doc = "Consumed charge, -1: autopilot does not provide consumption estimate"]
6655 pub current_consumed: i32,
6656 #[doc = "Consumed energy, -1: autopilot does not provide energy consumption estimate"]
6657 pub energy_consumed: i32,
6658 #[doc = "Temperature of the battery. INT16_MAX for unknown temperature."]
6659 pub temperature: i16,
6660 #[doc = "Battery voltage of cells 1 to 10 (see voltages_ext for cells 11-14). Cells in this field above the valid cell count for this battery should have the UINT16_MAX value. If individual cell voltages are unknown or not measured for this battery, then the overall battery voltage should be filled in cell 0, with all others set to UINT16_MAX. If the voltage of the battery is greater than (UINT16_MAX - 1), then cell 0 should be set to (UINT16_MAX - 1), and cell 1 to the remaining voltage. This can be extended to multiple cells if the total voltage is greater than 2 * (UINT16_MAX - 1)."]
6661 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
6662 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
6663 pub voltages: [u16; 10],
6664 #[doc = "Battery current, -1: autopilot does not measure the current"]
6665 pub current_battery: i16,
6666 #[doc = "Battery ID"]
6667 pub id: u8,
6668 #[doc = "Function of the battery"]
6669 pub battery_function: MavBatteryFunction,
6670 #[doc = "Type (chemistry) of the battery"]
6671 pub mavtype: MavBatteryType,
6672 #[doc = "Remaining battery energy. Values: [0-100], -1: autopilot does not estimate the remaining battery."]
6673 pub battery_remaining: i8,
6674 #[doc = "Remaining battery time, 0: autopilot does not provide remaining battery time estimate"]
6675 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
6676 pub time_remaining: i32,
6677 #[doc = "State for extent of discharge, provided by autopilot for warning or external reactions"]
6678 #[cfg_attr(feature = "serde", serde(default))]
6679 pub charge_state: MavBatteryChargeState,
6680 #[doc = "Battery voltages for cells 11 to 14. Cells above the valid cell count for this battery should have a value of 0, where zero indicates not supported (note, this is different than for the voltages field and allows empty byte truncation). If the measured value is 0 then 1 should be sent instead."]
6681 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
6682 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
6683 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
6684 pub voltages_ext: [u16; 4],
6685 #[doc = "Battery mode. Default (0) is that battery mode reporting is not supported or battery is in normal-use mode."]
6686 #[cfg_attr(feature = "serde", serde(default))]
6687 pub mode: MavBatteryMode,
6688 #[doc = "Fault/health indications. These should be set when charge_state is MAV_BATTERY_CHARGE_STATE_FAILED or MAV_BATTERY_CHARGE_STATE_UNHEALTHY (if not, fault reporting is not supported)."]
6689 #[cfg_attr(feature = "serde", serde(default))]
6690 pub fault_bitmask: MavBatteryFault,
6691}
6692impl BATTERY_STATUS_DATA {
6693 pub const ENCODED_LEN: usize = 54usize;
6694 pub const DEFAULT: Self = Self {
6695 current_consumed: 0_i32,
6696 energy_consumed: 0_i32,
6697 temperature: 0_i16,
6698 voltages: [0_u16; 10usize],
6699 current_battery: 0_i16,
6700 id: 0_u8,
6701 battery_function: MavBatteryFunction::DEFAULT,
6702 mavtype: MavBatteryType::DEFAULT,
6703 battery_remaining: 0_i8,
6704 time_remaining: 0_i32,
6705 charge_state: MavBatteryChargeState::DEFAULT,
6706 voltages_ext: [0_u16; 4usize],
6707 mode: MavBatteryMode::DEFAULT,
6708 fault_bitmask: MavBatteryFault::DEFAULT,
6709 };
6710 #[cfg(feature = "arbitrary")]
6711 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
6712 use arbitrary::{Arbitrary, Unstructured};
6713 let mut buf = [0u8; 1024];
6714 rng.fill_bytes(&mut buf);
6715 let mut unstructured = Unstructured::new(&buf);
6716 Self::arbitrary(&mut unstructured).unwrap_or_default()
6717 }
6718}
6719impl Default for BATTERY_STATUS_DATA {
6720 fn default() -> Self {
6721 Self::DEFAULT.clone()
6722 }
6723}
6724impl MessageData for BATTERY_STATUS_DATA {
6725 type Message = MavMessage;
6726 const ID: u32 = 147u32;
6727 const NAME: &'static str = "BATTERY_STATUS";
6728 const EXTRA_CRC: u8 = 154u8;
6729 const ENCODED_LEN: usize = 54usize;
6730 fn deser(
6731 _version: MavlinkVersion,
6732 __input: &[u8],
6733 ) -> Result<Self, ::mavlink_core::error::ParserError> {
6734 let avail_len = __input.len();
6735 let mut payload_buf = [0; Self::ENCODED_LEN];
6736 let mut buf = if avail_len < Self::ENCODED_LEN {
6737 payload_buf[0..avail_len].copy_from_slice(__input);
6738 Bytes::new(&payload_buf)
6739 } else {
6740 Bytes::new(__input)
6741 };
6742 let mut __struct = Self::default();
6743 __struct.current_consumed = buf.get_i32_le();
6744 __struct.energy_consumed = buf.get_i32_le();
6745 __struct.temperature = buf.get_i16_le();
6746 for v in &mut __struct.voltages {
6747 let val = buf.get_u16_le();
6748 *v = val;
6749 }
6750 __struct.current_battery = buf.get_i16_le();
6751 __struct.id = buf.get_u8();
6752 let tmp = buf.get_u8();
6753 __struct.battery_function =
6754 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
6755 enum_type: "MavBatteryFunction",
6756 value: tmp as u64,
6757 })?;
6758 let tmp = buf.get_u8();
6759 __struct.mavtype =
6760 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
6761 enum_type: "MavBatteryType",
6762 value: tmp as u64,
6763 })?;
6764 __struct.battery_remaining = buf.get_i8();
6765 __struct.time_remaining = buf.get_i32_le();
6766 let tmp = buf.get_u8();
6767 __struct.charge_state =
6768 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
6769 enum_type: "MavBatteryChargeState",
6770 value: tmp as u64,
6771 })?;
6772 for v in &mut __struct.voltages_ext {
6773 let val = buf.get_u16_le();
6774 *v = val;
6775 }
6776 let tmp = buf.get_u8();
6777 __struct.mode =
6778 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
6779 enum_type: "MavBatteryMode",
6780 value: tmp as u64,
6781 })?;
6782 let tmp = buf.get_u32_le();
6783 __struct.fault_bitmask = MavBatteryFault::from_bits(
6784 tmp as <MavBatteryFault as Flags>::Bits,
6785 )
6786 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
6787 flag_type: "MavBatteryFault",
6788 value: tmp as u64,
6789 })?;
6790 Ok(__struct)
6791 }
6792 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
6793 let mut __tmp = BytesMut::new(bytes);
6794 #[allow(clippy::absurd_extreme_comparisons)]
6795 #[allow(unused_comparisons)]
6796 if __tmp.remaining() < Self::ENCODED_LEN {
6797 panic!(
6798 "buffer is too small (need {} bytes, but got {})",
6799 Self::ENCODED_LEN,
6800 __tmp.remaining(),
6801 )
6802 }
6803 __tmp.put_i32_le(self.current_consumed);
6804 __tmp.put_i32_le(self.energy_consumed);
6805 __tmp.put_i16_le(self.temperature);
6806 for val in &self.voltages {
6807 __tmp.put_u16_le(*val);
6808 }
6809 __tmp.put_i16_le(self.current_battery);
6810 __tmp.put_u8(self.id);
6811 __tmp.put_u8(self.battery_function as u8);
6812 __tmp.put_u8(self.mavtype as u8);
6813 __tmp.put_i8(self.battery_remaining);
6814 if matches!(version, MavlinkVersion::V2) {
6815 __tmp.put_i32_le(self.time_remaining);
6816 __tmp.put_u8(self.charge_state as u8);
6817 for val in &self.voltages_ext {
6818 __tmp.put_u16_le(*val);
6819 }
6820 __tmp.put_u8(self.mode as u8);
6821 __tmp.put_u32_le(self.fault_bitmask.bits() as u32);
6822 let len = __tmp.len();
6823 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
6824 } else {
6825 __tmp.len()
6826 }
6827 }
6828}
6829#[doc = "Report button state change."]
6830#[doc = ""]
6831#[doc = "ID: 257"]
6832#[derive(Debug, Clone, PartialEq)]
6833#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
6834#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
6835#[cfg_attr(feature = "ts", derive(TS))]
6836#[cfg_attr(feature = "ts", ts(export))]
6837pub struct BUTTON_CHANGE_DATA {
6838 #[doc = "Timestamp (time since system boot)."]
6839 pub time_boot_ms: u32,
6840 #[doc = "Time of last change of button state."]
6841 pub last_change_ms: u32,
6842 #[doc = "Bitmap for state of buttons."]
6843 pub state: u8,
6844}
6845impl BUTTON_CHANGE_DATA {
6846 pub const ENCODED_LEN: usize = 9usize;
6847 pub const DEFAULT: Self = Self {
6848 time_boot_ms: 0_u32,
6849 last_change_ms: 0_u32,
6850 state: 0_u8,
6851 };
6852 #[cfg(feature = "arbitrary")]
6853 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
6854 use arbitrary::{Arbitrary, Unstructured};
6855 let mut buf = [0u8; 1024];
6856 rng.fill_bytes(&mut buf);
6857 let mut unstructured = Unstructured::new(&buf);
6858 Self::arbitrary(&mut unstructured).unwrap_or_default()
6859 }
6860}
6861impl Default for BUTTON_CHANGE_DATA {
6862 fn default() -> Self {
6863 Self::DEFAULT.clone()
6864 }
6865}
6866impl MessageData for BUTTON_CHANGE_DATA {
6867 type Message = MavMessage;
6868 const ID: u32 = 257u32;
6869 const NAME: &'static str = "BUTTON_CHANGE";
6870 const EXTRA_CRC: u8 = 131u8;
6871 const ENCODED_LEN: usize = 9usize;
6872 fn deser(
6873 _version: MavlinkVersion,
6874 __input: &[u8],
6875 ) -> Result<Self, ::mavlink_core::error::ParserError> {
6876 let avail_len = __input.len();
6877 let mut payload_buf = [0; Self::ENCODED_LEN];
6878 let mut buf = if avail_len < Self::ENCODED_LEN {
6879 payload_buf[0..avail_len].copy_from_slice(__input);
6880 Bytes::new(&payload_buf)
6881 } else {
6882 Bytes::new(__input)
6883 };
6884 let mut __struct = Self::default();
6885 __struct.time_boot_ms = buf.get_u32_le();
6886 __struct.last_change_ms = buf.get_u32_le();
6887 __struct.state = buf.get_u8();
6888 Ok(__struct)
6889 }
6890 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
6891 let mut __tmp = BytesMut::new(bytes);
6892 #[allow(clippy::absurd_extreme_comparisons)]
6893 #[allow(unused_comparisons)]
6894 if __tmp.remaining() < Self::ENCODED_LEN {
6895 panic!(
6896 "buffer is too small (need {} bytes, but got {})",
6897 Self::ENCODED_LEN,
6898 __tmp.remaining(),
6899 )
6900 }
6901 __tmp.put_u32_le(self.time_boot_ms);
6902 __tmp.put_u32_le(self.last_change_ms);
6903 __tmp.put_u8(self.state);
6904 if matches!(version, MavlinkVersion::V2) {
6905 let len = __tmp.len();
6906 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
6907 } else {
6908 __tmp.len()
6909 }
6910 }
6911}
6912#[doc = "Information about the status of a capture. Can be requested with a MAV_CMD_REQUEST_MESSAGE command."]
6913#[doc = ""]
6914#[doc = "ID: 262"]
6915#[derive(Debug, Clone, PartialEq)]
6916#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
6917#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
6918#[cfg_attr(feature = "ts", derive(TS))]
6919#[cfg_attr(feature = "ts", ts(export))]
6920pub struct CAMERA_CAPTURE_STATUS_DATA {
6921 #[doc = "Timestamp (time since system boot)."]
6922 pub time_boot_ms: u32,
6923 #[doc = "Image capture interval"]
6924 pub image_interval: f32,
6925 #[doc = "Elapsed time since recording started (0: Not supported/available). A GCS should compute recording time and use non-zero values of this field to correct any discrepancy."]
6926 pub recording_time_ms: u32,
6927 #[doc = "Available storage capacity."]
6928 pub available_capacity: f32,
6929 #[doc = "Current status of image capturing (0: idle, 1: capture in progress, 2: interval set but idle, 3: interval set and capture in progress)"]
6930 pub image_status: u8,
6931 #[doc = "Current status of video capturing (0: idle, 1: capture in progress)"]
6932 pub video_status: u8,
6933 #[doc = "Total number of images captured ('forever', or until reset using MAV_CMD_STORAGE_FORMAT)."]
6934 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
6935 pub image_count: i32,
6936 #[doc = "Camera id of a non-MAVLink camera attached to an autopilot (1-6). 0 if the component is a MAVLink camera (with its own component id)."]
6937 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
6938 pub camera_device_id: u8,
6939}
6940impl CAMERA_CAPTURE_STATUS_DATA {
6941 pub const ENCODED_LEN: usize = 23usize;
6942 pub const DEFAULT: Self = Self {
6943 time_boot_ms: 0_u32,
6944 image_interval: 0.0_f32,
6945 recording_time_ms: 0_u32,
6946 available_capacity: 0.0_f32,
6947 image_status: 0_u8,
6948 video_status: 0_u8,
6949 image_count: 0_i32,
6950 camera_device_id: 0_u8,
6951 };
6952 #[cfg(feature = "arbitrary")]
6953 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
6954 use arbitrary::{Arbitrary, Unstructured};
6955 let mut buf = [0u8; 1024];
6956 rng.fill_bytes(&mut buf);
6957 let mut unstructured = Unstructured::new(&buf);
6958 Self::arbitrary(&mut unstructured).unwrap_or_default()
6959 }
6960}
6961impl Default for CAMERA_CAPTURE_STATUS_DATA {
6962 fn default() -> Self {
6963 Self::DEFAULT.clone()
6964 }
6965}
6966impl MessageData for CAMERA_CAPTURE_STATUS_DATA {
6967 type Message = MavMessage;
6968 const ID: u32 = 262u32;
6969 const NAME: &'static str = "CAMERA_CAPTURE_STATUS";
6970 const EXTRA_CRC: u8 = 12u8;
6971 const ENCODED_LEN: usize = 23usize;
6972 fn deser(
6973 _version: MavlinkVersion,
6974 __input: &[u8],
6975 ) -> Result<Self, ::mavlink_core::error::ParserError> {
6976 let avail_len = __input.len();
6977 let mut payload_buf = [0; Self::ENCODED_LEN];
6978 let mut buf = if avail_len < Self::ENCODED_LEN {
6979 payload_buf[0..avail_len].copy_from_slice(__input);
6980 Bytes::new(&payload_buf)
6981 } else {
6982 Bytes::new(__input)
6983 };
6984 let mut __struct = Self::default();
6985 __struct.time_boot_ms = buf.get_u32_le();
6986 __struct.image_interval = buf.get_f32_le();
6987 __struct.recording_time_ms = buf.get_u32_le();
6988 __struct.available_capacity = buf.get_f32_le();
6989 __struct.image_status = buf.get_u8();
6990 __struct.video_status = buf.get_u8();
6991 __struct.image_count = buf.get_i32_le();
6992 __struct.camera_device_id = buf.get_u8();
6993 Ok(__struct)
6994 }
6995 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
6996 let mut __tmp = BytesMut::new(bytes);
6997 #[allow(clippy::absurd_extreme_comparisons)]
6998 #[allow(unused_comparisons)]
6999 if __tmp.remaining() < Self::ENCODED_LEN {
7000 panic!(
7001 "buffer is too small (need {} bytes, but got {})",
7002 Self::ENCODED_LEN,
7003 __tmp.remaining(),
7004 )
7005 }
7006 __tmp.put_u32_le(self.time_boot_ms);
7007 __tmp.put_f32_le(self.image_interval);
7008 __tmp.put_u32_le(self.recording_time_ms);
7009 __tmp.put_f32_le(self.available_capacity);
7010 __tmp.put_u8(self.image_status);
7011 __tmp.put_u8(self.video_status);
7012 if matches!(version, MavlinkVersion::V2) {
7013 __tmp.put_i32_le(self.image_count);
7014 __tmp.put_u8(self.camera_device_id);
7015 let len = __tmp.len();
7016 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
7017 } else {
7018 __tmp.len()
7019 }
7020 }
7021}
7022#[doc = "Information about the field of view of a camera. Can be requested with a MAV_CMD_REQUEST_MESSAGE command."]
7023#[doc = ""]
7024#[doc = "ID: 271"]
7025#[derive(Debug, Clone, PartialEq)]
7026#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
7027#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
7028#[cfg_attr(feature = "ts", derive(TS))]
7029#[cfg_attr(feature = "ts", ts(export))]
7030pub struct CAMERA_FOV_STATUS_DATA {
7031 #[doc = "Timestamp (time since system boot)."]
7032 pub time_boot_ms: u32,
7033 #[doc = "Latitude of camera (INT32_MAX if unknown)."]
7034 pub lat_camera: i32,
7035 #[doc = "Longitude of camera (INT32_MAX if unknown)."]
7036 pub lon_camera: i32,
7037 #[doc = "Altitude (MSL) of camera (INT32_MAX if unknown)."]
7038 pub alt_camera: i32,
7039 #[doc = "Latitude of center of image (INT32_MAX if unknown, INT32_MIN if at infinity, not intersecting with horizon)."]
7040 pub lat_image: i32,
7041 #[doc = "Longitude of center of image (INT32_MAX if unknown, INT32_MIN if at infinity, not intersecting with horizon)."]
7042 pub lon_image: i32,
7043 #[doc = "Altitude (MSL) of center of image (INT32_MAX if unknown, INT32_MIN if at infinity, not intersecting with horizon)."]
7044 pub alt_image: i32,
7045 #[doc = "Quaternion of camera orientation (w, x, y, z order, zero-rotation is 1, 0, 0, 0)"]
7046 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
7047 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
7048 pub q: [f32; 4],
7049 #[doc = "Horizontal field of view (NaN if unknown)."]
7050 pub hfov: f32,
7051 #[doc = "Vertical field of view (NaN if unknown)."]
7052 pub vfov: f32,
7053 #[doc = "Camera id of a non-MAVLink camera attached to an autopilot (1-6). 0 if the component is a MAVLink camera (with its own component id)."]
7054 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
7055 pub camera_device_id: u8,
7056}
7057impl CAMERA_FOV_STATUS_DATA {
7058 pub const ENCODED_LEN: usize = 53usize;
7059 pub const DEFAULT: Self = Self {
7060 time_boot_ms: 0_u32,
7061 lat_camera: 0_i32,
7062 lon_camera: 0_i32,
7063 alt_camera: 0_i32,
7064 lat_image: 0_i32,
7065 lon_image: 0_i32,
7066 alt_image: 0_i32,
7067 q: [0.0_f32; 4usize],
7068 hfov: 0.0_f32,
7069 vfov: 0.0_f32,
7070 camera_device_id: 0_u8,
7071 };
7072 #[cfg(feature = "arbitrary")]
7073 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
7074 use arbitrary::{Arbitrary, Unstructured};
7075 let mut buf = [0u8; 1024];
7076 rng.fill_bytes(&mut buf);
7077 let mut unstructured = Unstructured::new(&buf);
7078 Self::arbitrary(&mut unstructured).unwrap_or_default()
7079 }
7080}
7081impl Default for CAMERA_FOV_STATUS_DATA {
7082 fn default() -> Self {
7083 Self::DEFAULT.clone()
7084 }
7085}
7086impl MessageData for CAMERA_FOV_STATUS_DATA {
7087 type Message = MavMessage;
7088 const ID: u32 = 271u32;
7089 const NAME: &'static str = "CAMERA_FOV_STATUS";
7090 const EXTRA_CRC: u8 = 22u8;
7091 const ENCODED_LEN: usize = 53usize;
7092 fn deser(
7093 _version: MavlinkVersion,
7094 __input: &[u8],
7095 ) -> Result<Self, ::mavlink_core::error::ParserError> {
7096 let avail_len = __input.len();
7097 let mut payload_buf = [0; Self::ENCODED_LEN];
7098 let mut buf = if avail_len < Self::ENCODED_LEN {
7099 payload_buf[0..avail_len].copy_from_slice(__input);
7100 Bytes::new(&payload_buf)
7101 } else {
7102 Bytes::new(__input)
7103 };
7104 let mut __struct = Self::default();
7105 __struct.time_boot_ms = buf.get_u32_le();
7106 __struct.lat_camera = buf.get_i32_le();
7107 __struct.lon_camera = buf.get_i32_le();
7108 __struct.alt_camera = buf.get_i32_le();
7109 __struct.lat_image = buf.get_i32_le();
7110 __struct.lon_image = buf.get_i32_le();
7111 __struct.alt_image = buf.get_i32_le();
7112 for v in &mut __struct.q {
7113 let val = buf.get_f32_le();
7114 *v = val;
7115 }
7116 __struct.hfov = buf.get_f32_le();
7117 __struct.vfov = buf.get_f32_le();
7118 __struct.camera_device_id = buf.get_u8();
7119 Ok(__struct)
7120 }
7121 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
7122 let mut __tmp = BytesMut::new(bytes);
7123 #[allow(clippy::absurd_extreme_comparisons)]
7124 #[allow(unused_comparisons)]
7125 if __tmp.remaining() < Self::ENCODED_LEN {
7126 panic!(
7127 "buffer is too small (need {} bytes, but got {})",
7128 Self::ENCODED_LEN,
7129 __tmp.remaining(),
7130 )
7131 }
7132 __tmp.put_u32_le(self.time_boot_ms);
7133 __tmp.put_i32_le(self.lat_camera);
7134 __tmp.put_i32_le(self.lon_camera);
7135 __tmp.put_i32_le(self.alt_camera);
7136 __tmp.put_i32_le(self.lat_image);
7137 __tmp.put_i32_le(self.lon_image);
7138 __tmp.put_i32_le(self.alt_image);
7139 for val in &self.q {
7140 __tmp.put_f32_le(*val);
7141 }
7142 __tmp.put_f32_le(self.hfov);
7143 __tmp.put_f32_le(self.vfov);
7144 if matches!(version, MavlinkVersion::V2) {
7145 __tmp.put_u8(self.camera_device_id);
7146 let len = __tmp.len();
7147 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
7148 } else {
7149 __tmp.len()
7150 }
7151 }
7152}
7153#[doc = "Information about a captured image. This is emitted every time a message is captured. MAV_CMD_REQUEST_MESSAGE can be used to (re)request this message for a specific sequence number or range of sequence numbers: MAV_CMD_REQUEST_MESSAGE.param2 indicates the sequence number the first image to send, or set to -1 to send the message for all sequence numbers. MAV_CMD_REQUEST_MESSAGE.param3 is used to specify a range of messages to send: set to 0 (default) to send just the the message for the sequence number in param 2, set to -1 to send the message for the sequence number in param 2 and all the following sequence numbers, set to the sequence number of the final message in the range."]
7154#[doc = ""]
7155#[doc = "ID: 263"]
7156#[derive(Debug, Clone, PartialEq)]
7157#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
7158#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
7159#[cfg_attr(feature = "ts", derive(TS))]
7160#[cfg_attr(feature = "ts", ts(export))]
7161pub struct CAMERA_IMAGE_CAPTURED_DATA {
7162 #[doc = "Timestamp (time since UNIX epoch) in UTC. 0 for unknown."]
7163 pub time_utc: u64,
7164 #[doc = "Timestamp (time since system boot)."]
7165 pub time_boot_ms: u32,
7166 #[doc = "Latitude where image was taken"]
7167 pub lat: i32,
7168 #[doc = "Longitude where capture was taken"]
7169 pub lon: i32,
7170 #[doc = "Altitude (MSL) where image was taken"]
7171 pub alt: i32,
7172 #[doc = "Altitude above ground"]
7173 pub relative_alt: i32,
7174 #[doc = "Quaternion of camera orientation (w, x, y, z order, zero-rotation is 1, 0, 0, 0)"]
7175 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
7176 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
7177 pub q: [f32; 4],
7178 #[doc = "Zero based index of this image (i.e. a new image will have index CAMERA_CAPTURE_STATUS.image count -1)"]
7179 pub image_index: i32,
7180 #[doc = "Camera id of a non-MAVLink camera attached to an autopilot (1-6). 0 if the component is a MAVLink camera (with its own component id). Field name is usually camera_device_id."]
7181 pub camera_id: u8,
7182 #[doc = "Boolean indicating success (1) or failure (0) while capturing this image."]
7183 pub capture_result: i8,
7184 #[doc = "URL of image taken. Either local storage or <http://foo.jpg> if camera provides an HTTP interface."]
7185 #[cfg_attr(feature = "ts", ts(type = "string"))]
7186 pub file_url: CharArray<205>,
7187}
7188impl CAMERA_IMAGE_CAPTURED_DATA {
7189 pub const ENCODED_LEN: usize = 255usize;
7190 pub const DEFAULT: Self = Self {
7191 time_utc: 0_u64,
7192 time_boot_ms: 0_u32,
7193 lat: 0_i32,
7194 lon: 0_i32,
7195 alt: 0_i32,
7196 relative_alt: 0_i32,
7197 q: [0.0_f32; 4usize],
7198 image_index: 0_i32,
7199 camera_id: 0_u8,
7200 capture_result: 0_i8,
7201 file_url: CharArray::new([0_u8; 205usize]),
7202 };
7203 #[cfg(feature = "arbitrary")]
7204 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
7205 use arbitrary::{Arbitrary, Unstructured};
7206 let mut buf = [0u8; 1024];
7207 rng.fill_bytes(&mut buf);
7208 let mut unstructured = Unstructured::new(&buf);
7209 Self::arbitrary(&mut unstructured).unwrap_or_default()
7210 }
7211}
7212impl Default for CAMERA_IMAGE_CAPTURED_DATA {
7213 fn default() -> Self {
7214 Self::DEFAULT.clone()
7215 }
7216}
7217impl MessageData for CAMERA_IMAGE_CAPTURED_DATA {
7218 type Message = MavMessage;
7219 const ID: u32 = 263u32;
7220 const NAME: &'static str = "CAMERA_IMAGE_CAPTURED";
7221 const EXTRA_CRC: u8 = 133u8;
7222 const ENCODED_LEN: usize = 255usize;
7223 fn deser(
7224 _version: MavlinkVersion,
7225 __input: &[u8],
7226 ) -> Result<Self, ::mavlink_core::error::ParserError> {
7227 let avail_len = __input.len();
7228 let mut payload_buf = [0; Self::ENCODED_LEN];
7229 let mut buf = if avail_len < Self::ENCODED_LEN {
7230 payload_buf[0..avail_len].copy_from_slice(__input);
7231 Bytes::new(&payload_buf)
7232 } else {
7233 Bytes::new(__input)
7234 };
7235 let mut __struct = Self::default();
7236 __struct.time_utc = buf.get_u64_le();
7237 __struct.time_boot_ms = buf.get_u32_le();
7238 __struct.lat = buf.get_i32_le();
7239 __struct.lon = buf.get_i32_le();
7240 __struct.alt = buf.get_i32_le();
7241 __struct.relative_alt = buf.get_i32_le();
7242 for v in &mut __struct.q {
7243 let val = buf.get_f32_le();
7244 *v = val;
7245 }
7246 __struct.image_index = buf.get_i32_le();
7247 __struct.camera_id = buf.get_u8();
7248 __struct.capture_result = buf.get_i8();
7249 let mut tmp = [0_u8; 205usize];
7250 for v in &mut tmp {
7251 *v = buf.get_u8();
7252 }
7253 __struct.file_url = CharArray::new(tmp);
7254 Ok(__struct)
7255 }
7256 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
7257 let mut __tmp = BytesMut::new(bytes);
7258 #[allow(clippy::absurd_extreme_comparisons)]
7259 #[allow(unused_comparisons)]
7260 if __tmp.remaining() < Self::ENCODED_LEN {
7261 panic!(
7262 "buffer is too small (need {} bytes, but got {})",
7263 Self::ENCODED_LEN,
7264 __tmp.remaining(),
7265 )
7266 }
7267 __tmp.put_u64_le(self.time_utc);
7268 __tmp.put_u32_le(self.time_boot_ms);
7269 __tmp.put_i32_le(self.lat);
7270 __tmp.put_i32_le(self.lon);
7271 __tmp.put_i32_le(self.alt);
7272 __tmp.put_i32_le(self.relative_alt);
7273 for val in &self.q {
7274 __tmp.put_f32_le(*val);
7275 }
7276 __tmp.put_i32_le(self.image_index);
7277 __tmp.put_u8(self.camera_id);
7278 __tmp.put_i8(self.capture_result);
7279 for val in &self.file_url {
7280 __tmp.put_u8(*val);
7281 }
7282 if matches!(version, MavlinkVersion::V2) {
7283 let len = __tmp.len();
7284 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
7285 } else {
7286 __tmp.len()
7287 }
7288 }
7289}
7290#[doc = "Information about a camera. Can be requested with a MAV_CMD_REQUEST_MESSAGE command."]
7291#[doc = ""]
7292#[doc = "ID: 259"]
7293#[derive(Debug, Clone, PartialEq)]
7294#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
7295#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
7296#[cfg_attr(feature = "ts", derive(TS))]
7297#[cfg_attr(feature = "ts", ts(export))]
7298pub struct CAMERA_INFORMATION_DATA {
7299 #[doc = "Timestamp (time since system boot)."]
7300 pub time_boot_ms: u32,
7301 #[doc = "0xff). Use 0 if not known."]
7302 pub firmware_version: u32,
7303 #[doc = "Focal length. Use NaN if not known."]
7304 pub focal_length: f32,
7305 #[doc = "Image sensor size horizontal. Use NaN if not known."]
7306 pub sensor_size_h: f32,
7307 #[doc = "Image sensor size vertical. Use NaN if not known."]
7308 pub sensor_size_v: f32,
7309 #[doc = "Bitmap of camera capability flags."]
7310 pub flags: CameraCapFlags,
7311 #[doc = "Horizontal image resolution. Use 0 if not known."]
7312 pub resolution_h: u16,
7313 #[doc = "Vertical image resolution. Use 0 if not known."]
7314 pub resolution_v: u16,
7315 #[doc = "Camera definition version (iteration). Use 0 if not known."]
7316 pub cam_definition_version: u16,
7317 #[doc = "Name of the camera vendor"]
7318 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
7319 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
7320 pub vendor_name: [u8; 32],
7321 #[doc = "Name of the camera model"]
7322 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
7323 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
7324 pub model_name: [u8; 32],
7325 #[doc = "Reserved for a lens ID. Use 0 if not known."]
7326 pub lens_id: u8,
7327 #[doc = "Camera definition URI (if any, otherwise only basic functions will be available). HTTP- (http://) and MAVLink FTP- (mavlinkftp://) formatted URIs are allowed (and both must be supported by any GCS that implements the Camera Protocol). The definition file may be xz compressed, which will be indicated by the file extension .xml.xz (a GCS that implements the protocol must support decompressing the file). The string needs to be zero terminated. Use a zero-length string if not known."]
7328 #[cfg_attr(feature = "ts", ts(type = "string"))]
7329 pub cam_definition_uri: CharArray<140>,
7330 #[doc = "Gimbal id of a gimbal associated with this camera. This is the component id of the gimbal device, or 1-6 for non mavlink gimbals. Use 0 if no gimbal is associated with the camera."]
7331 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
7332 pub gimbal_device_id: u8,
7333 #[doc = "Camera id of a non-MAVLink camera attached to an autopilot (1-6). 0 if the component is a MAVLink camera (with its own component id)."]
7334 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
7335 pub camera_device_id: u8,
7336}
7337impl CAMERA_INFORMATION_DATA {
7338 pub const ENCODED_LEN: usize = 237usize;
7339 pub const DEFAULT: Self = Self {
7340 time_boot_ms: 0_u32,
7341 firmware_version: 0_u32,
7342 focal_length: 0.0_f32,
7343 sensor_size_h: 0.0_f32,
7344 sensor_size_v: 0.0_f32,
7345 flags: CameraCapFlags::DEFAULT,
7346 resolution_h: 0_u16,
7347 resolution_v: 0_u16,
7348 cam_definition_version: 0_u16,
7349 vendor_name: [0_u8; 32usize],
7350 model_name: [0_u8; 32usize],
7351 lens_id: 0_u8,
7352 cam_definition_uri: CharArray::new([0_u8; 140usize]),
7353 gimbal_device_id: 0_u8,
7354 camera_device_id: 0_u8,
7355 };
7356 #[cfg(feature = "arbitrary")]
7357 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
7358 use arbitrary::{Arbitrary, Unstructured};
7359 let mut buf = [0u8; 1024];
7360 rng.fill_bytes(&mut buf);
7361 let mut unstructured = Unstructured::new(&buf);
7362 Self::arbitrary(&mut unstructured).unwrap_or_default()
7363 }
7364}
7365impl Default for CAMERA_INFORMATION_DATA {
7366 fn default() -> Self {
7367 Self::DEFAULT.clone()
7368 }
7369}
7370impl MessageData for CAMERA_INFORMATION_DATA {
7371 type Message = MavMessage;
7372 const ID: u32 = 259u32;
7373 const NAME: &'static str = "CAMERA_INFORMATION";
7374 const EXTRA_CRC: u8 = 92u8;
7375 const ENCODED_LEN: usize = 237usize;
7376 fn deser(
7377 _version: MavlinkVersion,
7378 __input: &[u8],
7379 ) -> Result<Self, ::mavlink_core::error::ParserError> {
7380 let avail_len = __input.len();
7381 let mut payload_buf = [0; Self::ENCODED_LEN];
7382 let mut buf = if avail_len < Self::ENCODED_LEN {
7383 payload_buf[0..avail_len].copy_from_slice(__input);
7384 Bytes::new(&payload_buf)
7385 } else {
7386 Bytes::new(__input)
7387 };
7388 let mut __struct = Self::default();
7389 __struct.time_boot_ms = buf.get_u32_le();
7390 __struct.firmware_version = buf.get_u32_le();
7391 __struct.focal_length = buf.get_f32_le();
7392 __struct.sensor_size_h = buf.get_f32_le();
7393 __struct.sensor_size_v = buf.get_f32_le();
7394 let tmp = buf.get_u32_le();
7395 __struct.flags = CameraCapFlags::from_bits(tmp as <CameraCapFlags as Flags>::Bits).ok_or(
7396 ::mavlink_core::error::ParserError::InvalidFlag {
7397 flag_type: "CameraCapFlags",
7398 value: tmp as u64,
7399 },
7400 )?;
7401 __struct.resolution_h = buf.get_u16_le();
7402 __struct.resolution_v = buf.get_u16_le();
7403 __struct.cam_definition_version = buf.get_u16_le();
7404 for v in &mut __struct.vendor_name {
7405 let val = buf.get_u8();
7406 *v = val;
7407 }
7408 for v in &mut __struct.model_name {
7409 let val = buf.get_u8();
7410 *v = val;
7411 }
7412 __struct.lens_id = buf.get_u8();
7413 let mut tmp = [0_u8; 140usize];
7414 for v in &mut tmp {
7415 *v = buf.get_u8();
7416 }
7417 __struct.cam_definition_uri = CharArray::new(tmp);
7418 __struct.gimbal_device_id = buf.get_u8();
7419 __struct.camera_device_id = buf.get_u8();
7420 Ok(__struct)
7421 }
7422 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
7423 let mut __tmp = BytesMut::new(bytes);
7424 #[allow(clippy::absurd_extreme_comparisons)]
7425 #[allow(unused_comparisons)]
7426 if __tmp.remaining() < Self::ENCODED_LEN {
7427 panic!(
7428 "buffer is too small (need {} bytes, but got {})",
7429 Self::ENCODED_LEN,
7430 __tmp.remaining(),
7431 )
7432 }
7433 __tmp.put_u32_le(self.time_boot_ms);
7434 __tmp.put_u32_le(self.firmware_version);
7435 __tmp.put_f32_le(self.focal_length);
7436 __tmp.put_f32_le(self.sensor_size_h);
7437 __tmp.put_f32_le(self.sensor_size_v);
7438 __tmp.put_u32_le(self.flags.bits() as u32);
7439 __tmp.put_u16_le(self.resolution_h);
7440 __tmp.put_u16_le(self.resolution_v);
7441 __tmp.put_u16_le(self.cam_definition_version);
7442 for val in &self.vendor_name {
7443 __tmp.put_u8(*val);
7444 }
7445 for val in &self.model_name {
7446 __tmp.put_u8(*val);
7447 }
7448 __tmp.put_u8(self.lens_id);
7449 for val in &self.cam_definition_uri {
7450 __tmp.put_u8(*val);
7451 }
7452 if matches!(version, MavlinkVersion::V2) {
7453 __tmp.put_u8(self.gimbal_device_id);
7454 __tmp.put_u8(self.camera_device_id);
7455 let len = __tmp.len();
7456 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
7457 } else {
7458 __tmp.len()
7459 }
7460 }
7461}
7462#[doc = "Settings of a camera. Can be requested with a MAV_CMD_REQUEST_MESSAGE command."]
7463#[doc = ""]
7464#[doc = "ID: 260"]
7465#[derive(Debug, Clone, PartialEq)]
7466#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
7467#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
7468#[cfg_attr(feature = "ts", derive(TS))]
7469#[cfg_attr(feature = "ts", ts(export))]
7470pub struct CAMERA_SETTINGS_DATA {
7471 #[doc = "Timestamp (time since system boot)."]
7472 pub time_boot_ms: u32,
7473 #[doc = "Camera mode"]
7474 pub mode_id: CameraMode,
7475 #[doc = "Current zoom level as a percentage of the full range (0.0 to 100.0, NaN if not known)"]
7476 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
7477 pub zoomLevel: f32,
7478 #[doc = "Current focus level as a percentage of the full range (0.0 to 100.0, NaN if not known)"]
7479 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
7480 pub focusLevel: f32,
7481 #[doc = "Camera id of a non-MAVLink camera attached to an autopilot (1-6). 0 if the component is a MAVLink camera (with its own component id)."]
7482 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
7483 pub camera_device_id: u8,
7484}
7485impl CAMERA_SETTINGS_DATA {
7486 pub const ENCODED_LEN: usize = 14usize;
7487 pub const DEFAULT: Self = Self {
7488 time_boot_ms: 0_u32,
7489 mode_id: CameraMode::DEFAULT,
7490 zoomLevel: 0.0_f32,
7491 focusLevel: 0.0_f32,
7492 camera_device_id: 0_u8,
7493 };
7494 #[cfg(feature = "arbitrary")]
7495 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
7496 use arbitrary::{Arbitrary, Unstructured};
7497 let mut buf = [0u8; 1024];
7498 rng.fill_bytes(&mut buf);
7499 let mut unstructured = Unstructured::new(&buf);
7500 Self::arbitrary(&mut unstructured).unwrap_or_default()
7501 }
7502}
7503impl Default for CAMERA_SETTINGS_DATA {
7504 fn default() -> Self {
7505 Self::DEFAULT.clone()
7506 }
7507}
7508impl MessageData for CAMERA_SETTINGS_DATA {
7509 type Message = MavMessage;
7510 const ID: u32 = 260u32;
7511 const NAME: &'static str = "CAMERA_SETTINGS";
7512 const EXTRA_CRC: u8 = 146u8;
7513 const ENCODED_LEN: usize = 14usize;
7514 fn deser(
7515 _version: MavlinkVersion,
7516 __input: &[u8],
7517 ) -> Result<Self, ::mavlink_core::error::ParserError> {
7518 let avail_len = __input.len();
7519 let mut payload_buf = [0; Self::ENCODED_LEN];
7520 let mut buf = if avail_len < Self::ENCODED_LEN {
7521 payload_buf[0..avail_len].copy_from_slice(__input);
7522 Bytes::new(&payload_buf)
7523 } else {
7524 Bytes::new(__input)
7525 };
7526 let mut __struct = Self::default();
7527 __struct.time_boot_ms = buf.get_u32_le();
7528 let tmp = buf.get_u8();
7529 __struct.mode_id =
7530 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
7531 enum_type: "CameraMode",
7532 value: tmp as u64,
7533 })?;
7534 __struct.zoomLevel = buf.get_f32_le();
7535 __struct.focusLevel = buf.get_f32_le();
7536 __struct.camera_device_id = buf.get_u8();
7537 Ok(__struct)
7538 }
7539 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
7540 let mut __tmp = BytesMut::new(bytes);
7541 #[allow(clippy::absurd_extreme_comparisons)]
7542 #[allow(unused_comparisons)]
7543 if __tmp.remaining() < Self::ENCODED_LEN {
7544 panic!(
7545 "buffer is too small (need {} bytes, but got {})",
7546 Self::ENCODED_LEN,
7547 __tmp.remaining(),
7548 )
7549 }
7550 __tmp.put_u32_le(self.time_boot_ms);
7551 __tmp.put_u8(self.mode_id as u8);
7552 if matches!(version, MavlinkVersion::V2) {
7553 __tmp.put_f32_le(self.zoomLevel);
7554 __tmp.put_f32_le(self.focusLevel);
7555 __tmp.put_u8(self.camera_device_id);
7556 let len = __tmp.len();
7557 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
7558 } else {
7559 __tmp.len()
7560 }
7561 }
7562}
7563#[doc = "Camera absolute thermal range. This can be streamed when the associated VIDEO_STREAM_STATUS `flag` field bit VIDEO_STREAM_STATUS_FLAGS_THERMAL_RANGE_ENABLED is set, but a GCS may choose to only request it for the current active stream. Use MAV_CMD_SET_MESSAGE_INTERVAL to define message interval (param3 indicates the stream id of the current camera, or 0 for all streams, param4 indicates the target camera_device_id for autopilot-attached cameras or 0 for MAVLink cameras)."]
7564#[doc = ""]
7565#[doc = "ID: 277"]
7566#[derive(Debug, Clone, PartialEq)]
7567#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
7568#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
7569#[cfg_attr(feature = "ts", derive(TS))]
7570#[cfg_attr(feature = "ts", ts(export))]
7571pub struct CAMERA_THERMAL_RANGE_DATA {
7572 #[doc = "Timestamp (time since system boot)."]
7573 pub time_boot_ms: u32,
7574 #[doc = "Temperature max."]
7575 pub max: f32,
7576 #[doc = "Temperature max point x value (normalized 0..1, 0 is left, 1 is right), NAN if unknown."]
7577 pub max_point_x: f32,
7578 #[doc = "Temperature max point y value (normalized 0..1, 0 is top, 1 is bottom), NAN if unknown."]
7579 pub max_point_y: f32,
7580 #[doc = "Temperature min."]
7581 pub min: f32,
7582 #[doc = "Temperature min point x value (normalized 0..1, 0 is left, 1 is right), NAN if unknown."]
7583 pub min_point_x: f32,
7584 #[doc = "Temperature min point y value (normalized 0..1, 0 is top, 1 is bottom), NAN if unknown."]
7585 pub min_point_y: f32,
7586 #[doc = "Video Stream ID (1 for first, 2 for second, etc.)"]
7587 pub stream_id: u8,
7588 #[doc = "Camera id of a non-MAVLink camera attached to an autopilot (1-6). 0 if the component is a MAVLink camera (with its own component id)."]
7589 pub camera_device_id: u8,
7590}
7591impl CAMERA_THERMAL_RANGE_DATA {
7592 pub const ENCODED_LEN: usize = 30usize;
7593 pub const DEFAULT: Self = Self {
7594 time_boot_ms: 0_u32,
7595 max: 0.0_f32,
7596 max_point_x: 0.0_f32,
7597 max_point_y: 0.0_f32,
7598 min: 0.0_f32,
7599 min_point_x: 0.0_f32,
7600 min_point_y: 0.0_f32,
7601 stream_id: 0_u8,
7602 camera_device_id: 0_u8,
7603 };
7604 #[cfg(feature = "arbitrary")]
7605 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
7606 use arbitrary::{Arbitrary, Unstructured};
7607 let mut buf = [0u8; 1024];
7608 rng.fill_bytes(&mut buf);
7609 let mut unstructured = Unstructured::new(&buf);
7610 Self::arbitrary(&mut unstructured).unwrap_or_default()
7611 }
7612}
7613impl Default for CAMERA_THERMAL_RANGE_DATA {
7614 fn default() -> Self {
7615 Self::DEFAULT.clone()
7616 }
7617}
7618impl MessageData for CAMERA_THERMAL_RANGE_DATA {
7619 type Message = MavMessage;
7620 const ID: u32 = 277u32;
7621 const NAME: &'static str = "CAMERA_THERMAL_RANGE";
7622 const EXTRA_CRC: u8 = 62u8;
7623 const ENCODED_LEN: usize = 30usize;
7624 fn deser(
7625 _version: MavlinkVersion,
7626 __input: &[u8],
7627 ) -> Result<Self, ::mavlink_core::error::ParserError> {
7628 let avail_len = __input.len();
7629 let mut payload_buf = [0; Self::ENCODED_LEN];
7630 let mut buf = if avail_len < Self::ENCODED_LEN {
7631 payload_buf[0..avail_len].copy_from_slice(__input);
7632 Bytes::new(&payload_buf)
7633 } else {
7634 Bytes::new(__input)
7635 };
7636 let mut __struct = Self::default();
7637 __struct.time_boot_ms = buf.get_u32_le();
7638 __struct.max = buf.get_f32_le();
7639 __struct.max_point_x = buf.get_f32_le();
7640 __struct.max_point_y = buf.get_f32_le();
7641 __struct.min = buf.get_f32_le();
7642 __struct.min_point_x = buf.get_f32_le();
7643 __struct.min_point_y = buf.get_f32_le();
7644 __struct.stream_id = buf.get_u8();
7645 __struct.camera_device_id = buf.get_u8();
7646 Ok(__struct)
7647 }
7648 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
7649 let mut __tmp = BytesMut::new(bytes);
7650 #[allow(clippy::absurd_extreme_comparisons)]
7651 #[allow(unused_comparisons)]
7652 if __tmp.remaining() < Self::ENCODED_LEN {
7653 panic!(
7654 "buffer is too small (need {} bytes, but got {})",
7655 Self::ENCODED_LEN,
7656 __tmp.remaining(),
7657 )
7658 }
7659 __tmp.put_u32_le(self.time_boot_ms);
7660 __tmp.put_f32_le(self.max);
7661 __tmp.put_f32_le(self.max_point_x);
7662 __tmp.put_f32_le(self.max_point_y);
7663 __tmp.put_f32_le(self.min);
7664 __tmp.put_f32_le(self.min_point_x);
7665 __tmp.put_f32_le(self.min_point_y);
7666 __tmp.put_u8(self.stream_id);
7667 __tmp.put_u8(self.camera_device_id);
7668 if matches!(version, MavlinkVersion::V2) {
7669 let len = __tmp.len();
7670 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
7671 } else {
7672 __tmp.len()
7673 }
7674 }
7675}
7676#[doc = "Camera tracking status, sent while in active tracking. Use MAV_CMD_SET_MESSAGE_INTERVAL to define message interval."]
7677#[doc = ""]
7678#[doc = "ID: 276"]
7679#[derive(Debug, Clone, PartialEq)]
7680#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
7681#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
7682#[cfg_attr(feature = "ts", derive(TS))]
7683#[cfg_attr(feature = "ts", ts(export))]
7684pub struct CAMERA_TRACKING_GEO_STATUS_DATA {
7685 #[doc = "Latitude of tracked object"]
7686 pub lat: i32,
7687 #[doc = "Longitude of tracked object"]
7688 pub lon: i32,
7689 #[doc = "Altitude of tracked object(AMSL, WGS84)"]
7690 pub alt: f32,
7691 #[doc = "Horizontal accuracy. NAN if unknown"]
7692 pub h_acc: f32,
7693 #[doc = "Vertical accuracy. NAN if unknown"]
7694 pub v_acc: f32,
7695 #[doc = "North velocity of tracked object. NAN if unknown"]
7696 pub vel_n: f32,
7697 #[doc = "East velocity of tracked object. NAN if unknown"]
7698 pub vel_e: f32,
7699 #[doc = "Down velocity of tracked object. NAN if unknown"]
7700 pub vel_d: f32,
7701 #[doc = "Velocity accuracy. NAN if unknown"]
7702 pub vel_acc: f32,
7703 #[doc = "Distance between camera and tracked object. NAN if unknown"]
7704 pub dist: f32,
7705 #[doc = "Heading in radians, in NED. NAN if unknown"]
7706 pub hdg: f32,
7707 #[doc = "Accuracy of heading, in NED. NAN if unknown"]
7708 pub hdg_acc: f32,
7709 #[doc = "Current tracking status"]
7710 pub tracking_status: CameraTrackingStatusFlags,
7711 #[doc = "Camera id of a non-MAVLink camera attached to an autopilot (1-6). 0 if the component is a MAVLink camera (with its own component id)."]
7712 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
7713 pub camera_device_id: u8,
7714}
7715impl CAMERA_TRACKING_GEO_STATUS_DATA {
7716 pub const ENCODED_LEN: usize = 50usize;
7717 pub const DEFAULT: Self = Self {
7718 lat: 0_i32,
7719 lon: 0_i32,
7720 alt: 0.0_f32,
7721 h_acc: 0.0_f32,
7722 v_acc: 0.0_f32,
7723 vel_n: 0.0_f32,
7724 vel_e: 0.0_f32,
7725 vel_d: 0.0_f32,
7726 vel_acc: 0.0_f32,
7727 dist: 0.0_f32,
7728 hdg: 0.0_f32,
7729 hdg_acc: 0.0_f32,
7730 tracking_status: CameraTrackingStatusFlags::DEFAULT,
7731 camera_device_id: 0_u8,
7732 };
7733 #[cfg(feature = "arbitrary")]
7734 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
7735 use arbitrary::{Arbitrary, Unstructured};
7736 let mut buf = [0u8; 1024];
7737 rng.fill_bytes(&mut buf);
7738 let mut unstructured = Unstructured::new(&buf);
7739 Self::arbitrary(&mut unstructured).unwrap_or_default()
7740 }
7741}
7742impl Default for CAMERA_TRACKING_GEO_STATUS_DATA {
7743 fn default() -> Self {
7744 Self::DEFAULT.clone()
7745 }
7746}
7747impl MessageData for CAMERA_TRACKING_GEO_STATUS_DATA {
7748 type Message = MavMessage;
7749 const ID: u32 = 276u32;
7750 const NAME: &'static str = "CAMERA_TRACKING_GEO_STATUS";
7751 const EXTRA_CRC: u8 = 18u8;
7752 const ENCODED_LEN: usize = 50usize;
7753 fn deser(
7754 _version: MavlinkVersion,
7755 __input: &[u8],
7756 ) -> Result<Self, ::mavlink_core::error::ParserError> {
7757 let avail_len = __input.len();
7758 let mut payload_buf = [0; Self::ENCODED_LEN];
7759 let mut buf = if avail_len < Self::ENCODED_LEN {
7760 payload_buf[0..avail_len].copy_from_slice(__input);
7761 Bytes::new(&payload_buf)
7762 } else {
7763 Bytes::new(__input)
7764 };
7765 let mut __struct = Self::default();
7766 __struct.lat = buf.get_i32_le();
7767 __struct.lon = buf.get_i32_le();
7768 __struct.alt = buf.get_f32_le();
7769 __struct.h_acc = buf.get_f32_le();
7770 __struct.v_acc = buf.get_f32_le();
7771 __struct.vel_n = buf.get_f32_le();
7772 __struct.vel_e = buf.get_f32_le();
7773 __struct.vel_d = buf.get_f32_le();
7774 __struct.vel_acc = buf.get_f32_le();
7775 __struct.dist = buf.get_f32_le();
7776 __struct.hdg = buf.get_f32_le();
7777 __struct.hdg_acc = buf.get_f32_le();
7778 let tmp = buf.get_u8();
7779 __struct.tracking_status =
7780 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
7781 enum_type: "CameraTrackingStatusFlags",
7782 value: tmp as u64,
7783 })?;
7784 __struct.camera_device_id = buf.get_u8();
7785 Ok(__struct)
7786 }
7787 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
7788 let mut __tmp = BytesMut::new(bytes);
7789 #[allow(clippy::absurd_extreme_comparisons)]
7790 #[allow(unused_comparisons)]
7791 if __tmp.remaining() < Self::ENCODED_LEN {
7792 panic!(
7793 "buffer is too small (need {} bytes, but got {})",
7794 Self::ENCODED_LEN,
7795 __tmp.remaining(),
7796 )
7797 }
7798 __tmp.put_i32_le(self.lat);
7799 __tmp.put_i32_le(self.lon);
7800 __tmp.put_f32_le(self.alt);
7801 __tmp.put_f32_le(self.h_acc);
7802 __tmp.put_f32_le(self.v_acc);
7803 __tmp.put_f32_le(self.vel_n);
7804 __tmp.put_f32_le(self.vel_e);
7805 __tmp.put_f32_le(self.vel_d);
7806 __tmp.put_f32_le(self.vel_acc);
7807 __tmp.put_f32_le(self.dist);
7808 __tmp.put_f32_le(self.hdg);
7809 __tmp.put_f32_le(self.hdg_acc);
7810 __tmp.put_u8(self.tracking_status as u8);
7811 if matches!(version, MavlinkVersion::V2) {
7812 __tmp.put_u8(self.camera_device_id);
7813 let len = __tmp.len();
7814 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
7815 } else {
7816 __tmp.len()
7817 }
7818 }
7819}
7820#[doc = "Camera tracking status, sent while in active tracking. Use MAV_CMD_SET_MESSAGE_INTERVAL to define message interval."]
7821#[doc = ""]
7822#[doc = "ID: 275"]
7823#[derive(Debug, Clone, PartialEq)]
7824#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
7825#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
7826#[cfg_attr(feature = "ts", derive(TS))]
7827#[cfg_attr(feature = "ts", ts(export))]
7828pub struct CAMERA_TRACKING_IMAGE_STATUS_DATA {
7829 #[doc = "Current tracked point x value if CAMERA_TRACKING_MODE_POINT (normalized 0..1, 0 is left, 1 is right), NAN if unknown"]
7830 pub point_x: f32,
7831 #[doc = "Current tracked point y value if CAMERA_TRACKING_MODE_POINT (normalized 0..1, 0 is top, 1 is bottom), NAN if unknown"]
7832 pub point_y: f32,
7833 #[doc = "Current tracked radius if CAMERA_TRACKING_MODE_POINT (normalized 0..1, 0 is image left, 1 is image right), NAN if unknown"]
7834 pub radius: f32,
7835 #[doc = "Current tracked rectangle top x value if CAMERA_TRACKING_MODE_RECTANGLE (normalized 0..1, 0 is left, 1 is right), NAN if unknown"]
7836 pub rec_top_x: f32,
7837 #[doc = "Current tracked rectangle top y value if CAMERA_TRACKING_MODE_RECTANGLE (normalized 0..1, 0 is top, 1 is bottom), NAN if unknown"]
7838 pub rec_top_y: f32,
7839 #[doc = "Current tracked rectangle bottom x value if CAMERA_TRACKING_MODE_RECTANGLE (normalized 0..1, 0 is left, 1 is right), NAN if unknown"]
7840 pub rec_bottom_x: f32,
7841 #[doc = "Current tracked rectangle bottom y value if CAMERA_TRACKING_MODE_RECTANGLE (normalized 0..1, 0 is top, 1 is bottom), NAN if unknown"]
7842 pub rec_bottom_y: f32,
7843 #[doc = "Current tracking status"]
7844 pub tracking_status: CameraTrackingStatusFlags,
7845 #[doc = "Current tracking mode"]
7846 pub tracking_mode: CameraTrackingMode,
7847 #[doc = "Defines location of target data"]
7848 pub target_data: CameraTrackingTargetData,
7849 #[doc = "Camera id of a non-MAVLink camera attached to an autopilot (1-6). 0 if the component is a MAVLink camera (with its own component id)."]
7850 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
7851 pub camera_device_id: u8,
7852}
7853impl CAMERA_TRACKING_IMAGE_STATUS_DATA {
7854 pub const ENCODED_LEN: usize = 32usize;
7855 pub const DEFAULT: Self = Self {
7856 point_x: 0.0_f32,
7857 point_y: 0.0_f32,
7858 radius: 0.0_f32,
7859 rec_top_x: 0.0_f32,
7860 rec_top_y: 0.0_f32,
7861 rec_bottom_x: 0.0_f32,
7862 rec_bottom_y: 0.0_f32,
7863 tracking_status: CameraTrackingStatusFlags::DEFAULT,
7864 tracking_mode: CameraTrackingMode::DEFAULT,
7865 target_data: CameraTrackingTargetData::DEFAULT,
7866 camera_device_id: 0_u8,
7867 };
7868 #[cfg(feature = "arbitrary")]
7869 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
7870 use arbitrary::{Arbitrary, Unstructured};
7871 let mut buf = [0u8; 1024];
7872 rng.fill_bytes(&mut buf);
7873 let mut unstructured = Unstructured::new(&buf);
7874 Self::arbitrary(&mut unstructured).unwrap_or_default()
7875 }
7876}
7877impl Default for CAMERA_TRACKING_IMAGE_STATUS_DATA {
7878 fn default() -> Self {
7879 Self::DEFAULT.clone()
7880 }
7881}
7882impl MessageData for CAMERA_TRACKING_IMAGE_STATUS_DATA {
7883 type Message = MavMessage;
7884 const ID: u32 = 275u32;
7885 const NAME: &'static str = "CAMERA_TRACKING_IMAGE_STATUS";
7886 const EXTRA_CRC: u8 = 126u8;
7887 const ENCODED_LEN: usize = 32usize;
7888 fn deser(
7889 _version: MavlinkVersion,
7890 __input: &[u8],
7891 ) -> Result<Self, ::mavlink_core::error::ParserError> {
7892 let avail_len = __input.len();
7893 let mut payload_buf = [0; Self::ENCODED_LEN];
7894 let mut buf = if avail_len < Self::ENCODED_LEN {
7895 payload_buf[0..avail_len].copy_from_slice(__input);
7896 Bytes::new(&payload_buf)
7897 } else {
7898 Bytes::new(__input)
7899 };
7900 let mut __struct = Self::default();
7901 __struct.point_x = buf.get_f32_le();
7902 __struct.point_y = buf.get_f32_le();
7903 __struct.radius = buf.get_f32_le();
7904 __struct.rec_top_x = buf.get_f32_le();
7905 __struct.rec_top_y = buf.get_f32_le();
7906 __struct.rec_bottom_x = buf.get_f32_le();
7907 __struct.rec_bottom_y = buf.get_f32_le();
7908 let tmp = buf.get_u8();
7909 __struct.tracking_status =
7910 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
7911 enum_type: "CameraTrackingStatusFlags",
7912 value: tmp as u64,
7913 })?;
7914 let tmp = buf.get_u8();
7915 __struct.tracking_mode =
7916 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
7917 enum_type: "CameraTrackingMode",
7918 value: tmp as u64,
7919 })?;
7920 let tmp = buf.get_u8();
7921 __struct.target_data =
7922 CameraTrackingTargetData::from_bits(tmp as <CameraTrackingTargetData as Flags>::Bits)
7923 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
7924 flag_type: "CameraTrackingTargetData",
7925 value: tmp as u64,
7926 })?;
7927 __struct.camera_device_id = buf.get_u8();
7928 Ok(__struct)
7929 }
7930 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
7931 let mut __tmp = BytesMut::new(bytes);
7932 #[allow(clippy::absurd_extreme_comparisons)]
7933 #[allow(unused_comparisons)]
7934 if __tmp.remaining() < Self::ENCODED_LEN {
7935 panic!(
7936 "buffer is too small (need {} bytes, but got {})",
7937 Self::ENCODED_LEN,
7938 __tmp.remaining(),
7939 )
7940 }
7941 __tmp.put_f32_le(self.point_x);
7942 __tmp.put_f32_le(self.point_y);
7943 __tmp.put_f32_le(self.radius);
7944 __tmp.put_f32_le(self.rec_top_x);
7945 __tmp.put_f32_le(self.rec_top_y);
7946 __tmp.put_f32_le(self.rec_bottom_x);
7947 __tmp.put_f32_le(self.rec_bottom_y);
7948 __tmp.put_u8(self.tracking_status as u8);
7949 __tmp.put_u8(self.tracking_mode as u8);
7950 __tmp.put_u8(self.target_data.bits() as u8);
7951 if matches!(version, MavlinkVersion::V2) {
7952 __tmp.put_u8(self.camera_device_id);
7953 let len = __tmp.len();
7954 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
7955 } else {
7956 __tmp.len()
7957 }
7958 }
7959}
7960#[doc = "Camera-IMU triggering and synchronisation message."]
7961#[doc = ""]
7962#[doc = "ID: 112"]
7963#[derive(Debug, Clone, PartialEq)]
7964#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
7965#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
7966#[cfg_attr(feature = "ts", derive(TS))]
7967#[cfg_attr(feature = "ts", ts(export))]
7968pub struct CAMERA_TRIGGER_DATA {
7969 #[doc = "Timestamp for image frame (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
7970 pub time_usec: u64,
7971 #[doc = "Image frame sequence"]
7972 pub seq: u32,
7973}
7974impl CAMERA_TRIGGER_DATA {
7975 pub const ENCODED_LEN: usize = 12usize;
7976 pub const DEFAULT: Self = Self {
7977 time_usec: 0_u64,
7978 seq: 0_u32,
7979 };
7980 #[cfg(feature = "arbitrary")]
7981 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
7982 use arbitrary::{Arbitrary, Unstructured};
7983 let mut buf = [0u8; 1024];
7984 rng.fill_bytes(&mut buf);
7985 let mut unstructured = Unstructured::new(&buf);
7986 Self::arbitrary(&mut unstructured).unwrap_or_default()
7987 }
7988}
7989impl Default for CAMERA_TRIGGER_DATA {
7990 fn default() -> Self {
7991 Self::DEFAULT.clone()
7992 }
7993}
7994impl MessageData for CAMERA_TRIGGER_DATA {
7995 type Message = MavMessage;
7996 const ID: u32 = 112u32;
7997 const NAME: &'static str = "CAMERA_TRIGGER";
7998 const EXTRA_CRC: u8 = 174u8;
7999 const ENCODED_LEN: usize = 12usize;
8000 fn deser(
8001 _version: MavlinkVersion,
8002 __input: &[u8],
8003 ) -> Result<Self, ::mavlink_core::error::ParserError> {
8004 let avail_len = __input.len();
8005 let mut payload_buf = [0; Self::ENCODED_LEN];
8006 let mut buf = if avail_len < Self::ENCODED_LEN {
8007 payload_buf[0..avail_len].copy_from_slice(__input);
8008 Bytes::new(&payload_buf)
8009 } else {
8010 Bytes::new(__input)
8011 };
8012 let mut __struct = Self::default();
8013 __struct.time_usec = buf.get_u64_le();
8014 __struct.seq = buf.get_u32_le();
8015 Ok(__struct)
8016 }
8017 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
8018 let mut __tmp = BytesMut::new(bytes);
8019 #[allow(clippy::absurd_extreme_comparisons)]
8020 #[allow(unused_comparisons)]
8021 if __tmp.remaining() < Self::ENCODED_LEN {
8022 panic!(
8023 "buffer is too small (need {} bytes, but got {})",
8024 Self::ENCODED_LEN,
8025 __tmp.remaining(),
8026 )
8027 }
8028 __tmp.put_u64_le(self.time_usec);
8029 __tmp.put_u32_le(self.seq);
8030 if matches!(version, MavlinkVersion::V2) {
8031 let len = __tmp.len();
8032 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
8033 } else {
8034 __tmp.len()
8035 }
8036 }
8037}
8038#[doc = "A forwarded CANFD frame as requested by MAV_CMD_CAN_FORWARD. These are separated from CAN_FRAME as they need different handling (eg. TAO handling)."]
8039#[doc = ""]
8040#[doc = "ID: 387"]
8041#[derive(Debug, Clone, PartialEq)]
8042#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
8043#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
8044#[cfg_attr(feature = "ts", derive(TS))]
8045#[cfg_attr(feature = "ts", ts(export))]
8046pub struct CANFD_FRAME_DATA {
8047 #[doc = "Frame ID"]
8048 pub id: u32,
8049 #[doc = "System ID."]
8050 pub target_system: u8,
8051 #[doc = "Component ID."]
8052 pub target_component: u8,
8053 #[doc = "bus number"]
8054 pub bus: u8,
8055 #[doc = "Frame length"]
8056 pub len: u8,
8057 #[doc = "Frame data"]
8058 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
8059 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
8060 pub data: [u8; 64],
8061}
8062impl CANFD_FRAME_DATA {
8063 pub const ENCODED_LEN: usize = 72usize;
8064 pub const DEFAULT: Self = Self {
8065 id: 0_u32,
8066 target_system: 0_u8,
8067 target_component: 0_u8,
8068 bus: 0_u8,
8069 len: 0_u8,
8070 data: [0_u8; 64usize],
8071 };
8072 #[cfg(feature = "arbitrary")]
8073 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
8074 use arbitrary::{Arbitrary, Unstructured};
8075 let mut buf = [0u8; 1024];
8076 rng.fill_bytes(&mut buf);
8077 let mut unstructured = Unstructured::new(&buf);
8078 Self::arbitrary(&mut unstructured).unwrap_or_default()
8079 }
8080}
8081impl Default for CANFD_FRAME_DATA {
8082 fn default() -> Self {
8083 Self::DEFAULT.clone()
8084 }
8085}
8086impl MessageData for CANFD_FRAME_DATA {
8087 type Message = MavMessage;
8088 const ID: u32 = 387u32;
8089 const NAME: &'static str = "CANFD_FRAME";
8090 const EXTRA_CRC: u8 = 4u8;
8091 const ENCODED_LEN: usize = 72usize;
8092 fn deser(
8093 _version: MavlinkVersion,
8094 __input: &[u8],
8095 ) -> Result<Self, ::mavlink_core::error::ParserError> {
8096 let avail_len = __input.len();
8097 let mut payload_buf = [0; Self::ENCODED_LEN];
8098 let mut buf = if avail_len < Self::ENCODED_LEN {
8099 payload_buf[0..avail_len].copy_from_slice(__input);
8100 Bytes::new(&payload_buf)
8101 } else {
8102 Bytes::new(__input)
8103 };
8104 let mut __struct = Self::default();
8105 __struct.id = buf.get_u32_le();
8106 __struct.target_system = buf.get_u8();
8107 __struct.target_component = buf.get_u8();
8108 __struct.bus = buf.get_u8();
8109 __struct.len = buf.get_u8();
8110 for v in &mut __struct.data {
8111 let val = buf.get_u8();
8112 *v = val;
8113 }
8114 Ok(__struct)
8115 }
8116 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
8117 let mut __tmp = BytesMut::new(bytes);
8118 #[allow(clippy::absurd_extreme_comparisons)]
8119 #[allow(unused_comparisons)]
8120 if __tmp.remaining() < Self::ENCODED_LEN {
8121 panic!(
8122 "buffer is too small (need {} bytes, but got {})",
8123 Self::ENCODED_LEN,
8124 __tmp.remaining(),
8125 )
8126 }
8127 __tmp.put_u32_le(self.id);
8128 __tmp.put_u8(self.target_system);
8129 __tmp.put_u8(self.target_component);
8130 __tmp.put_u8(self.bus);
8131 __tmp.put_u8(self.len);
8132 for val in &self.data {
8133 __tmp.put_u8(*val);
8134 }
8135 if matches!(version, MavlinkVersion::V2) {
8136 let len = __tmp.len();
8137 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
8138 } else {
8139 __tmp.len()
8140 }
8141 }
8142}
8143#[doc = "Modify the filter of what CAN messages to forward over the mavlink. This can be used to make CAN forwarding work well on low bandwidth links. The filtering is applied on bits 8 to 24 of the CAN id (2nd and 3rd bytes) which corresponds to the DroneCAN message ID for DroneCAN. Filters with more than 16 IDs can be constructed by sending multiple CAN_FILTER_MODIFY messages."]
8144#[doc = ""]
8145#[doc = "ID: 388"]
8146#[derive(Debug, Clone, PartialEq)]
8147#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
8148#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
8149#[cfg_attr(feature = "ts", derive(TS))]
8150#[cfg_attr(feature = "ts", ts(export))]
8151pub struct CAN_FILTER_MODIFY_DATA {
8152 #[doc = "filter IDs, length num_ids"]
8153 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
8154 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
8155 pub ids: [u16; 16],
8156 #[doc = "System ID."]
8157 pub target_system: u8,
8158 #[doc = "Component ID."]
8159 pub target_component: u8,
8160 #[doc = "bus number"]
8161 pub bus: u8,
8162 #[doc = "what operation to perform on the filter list. See CAN_FILTER_OP enum."]
8163 pub operation: CanFilterOp,
8164 #[doc = "number of IDs in filter list"]
8165 pub num_ids: u8,
8166}
8167impl CAN_FILTER_MODIFY_DATA {
8168 pub const ENCODED_LEN: usize = 37usize;
8169 pub const DEFAULT: Self = Self {
8170 ids: [0_u16; 16usize],
8171 target_system: 0_u8,
8172 target_component: 0_u8,
8173 bus: 0_u8,
8174 operation: CanFilterOp::DEFAULT,
8175 num_ids: 0_u8,
8176 };
8177 #[cfg(feature = "arbitrary")]
8178 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
8179 use arbitrary::{Arbitrary, Unstructured};
8180 let mut buf = [0u8; 1024];
8181 rng.fill_bytes(&mut buf);
8182 let mut unstructured = Unstructured::new(&buf);
8183 Self::arbitrary(&mut unstructured).unwrap_or_default()
8184 }
8185}
8186impl Default for CAN_FILTER_MODIFY_DATA {
8187 fn default() -> Self {
8188 Self::DEFAULT.clone()
8189 }
8190}
8191impl MessageData for CAN_FILTER_MODIFY_DATA {
8192 type Message = MavMessage;
8193 const ID: u32 = 388u32;
8194 const NAME: &'static str = "CAN_FILTER_MODIFY";
8195 const EXTRA_CRC: u8 = 8u8;
8196 const ENCODED_LEN: usize = 37usize;
8197 fn deser(
8198 _version: MavlinkVersion,
8199 __input: &[u8],
8200 ) -> Result<Self, ::mavlink_core::error::ParserError> {
8201 let avail_len = __input.len();
8202 let mut payload_buf = [0; Self::ENCODED_LEN];
8203 let mut buf = if avail_len < Self::ENCODED_LEN {
8204 payload_buf[0..avail_len].copy_from_slice(__input);
8205 Bytes::new(&payload_buf)
8206 } else {
8207 Bytes::new(__input)
8208 };
8209 let mut __struct = Self::default();
8210 for v in &mut __struct.ids {
8211 let val = buf.get_u16_le();
8212 *v = val;
8213 }
8214 __struct.target_system = buf.get_u8();
8215 __struct.target_component = buf.get_u8();
8216 __struct.bus = buf.get_u8();
8217 let tmp = buf.get_u8();
8218 __struct.operation =
8219 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
8220 enum_type: "CanFilterOp",
8221 value: tmp as u64,
8222 })?;
8223 __struct.num_ids = buf.get_u8();
8224 Ok(__struct)
8225 }
8226 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
8227 let mut __tmp = BytesMut::new(bytes);
8228 #[allow(clippy::absurd_extreme_comparisons)]
8229 #[allow(unused_comparisons)]
8230 if __tmp.remaining() < Self::ENCODED_LEN {
8231 panic!(
8232 "buffer is too small (need {} bytes, but got {})",
8233 Self::ENCODED_LEN,
8234 __tmp.remaining(),
8235 )
8236 }
8237 for val in &self.ids {
8238 __tmp.put_u16_le(*val);
8239 }
8240 __tmp.put_u8(self.target_system);
8241 __tmp.put_u8(self.target_component);
8242 __tmp.put_u8(self.bus);
8243 __tmp.put_u8(self.operation as u8);
8244 __tmp.put_u8(self.num_ids);
8245 if matches!(version, MavlinkVersion::V2) {
8246 let len = __tmp.len();
8247 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
8248 } else {
8249 __tmp.len()
8250 }
8251 }
8252}
8253#[doc = "A forwarded CAN frame as requested by MAV_CMD_CAN_FORWARD."]
8254#[doc = ""]
8255#[doc = "ID: 386"]
8256#[derive(Debug, Clone, PartialEq)]
8257#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
8258#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
8259#[cfg_attr(feature = "ts", derive(TS))]
8260#[cfg_attr(feature = "ts", ts(export))]
8261pub struct CAN_FRAME_DATA {
8262 #[doc = "Frame ID"]
8263 pub id: u32,
8264 #[doc = "System ID."]
8265 pub target_system: u8,
8266 #[doc = "Component ID."]
8267 pub target_component: u8,
8268 #[doc = "Bus number"]
8269 pub bus: u8,
8270 #[doc = "Frame length"]
8271 pub len: u8,
8272 #[doc = "Frame data"]
8273 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
8274 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
8275 pub data: [u8; 8],
8276}
8277impl CAN_FRAME_DATA {
8278 pub const ENCODED_LEN: usize = 16usize;
8279 pub const DEFAULT: Self = Self {
8280 id: 0_u32,
8281 target_system: 0_u8,
8282 target_component: 0_u8,
8283 bus: 0_u8,
8284 len: 0_u8,
8285 data: [0_u8; 8usize],
8286 };
8287 #[cfg(feature = "arbitrary")]
8288 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
8289 use arbitrary::{Arbitrary, Unstructured};
8290 let mut buf = [0u8; 1024];
8291 rng.fill_bytes(&mut buf);
8292 let mut unstructured = Unstructured::new(&buf);
8293 Self::arbitrary(&mut unstructured).unwrap_or_default()
8294 }
8295}
8296impl Default for CAN_FRAME_DATA {
8297 fn default() -> Self {
8298 Self::DEFAULT.clone()
8299 }
8300}
8301impl MessageData for CAN_FRAME_DATA {
8302 type Message = MavMessage;
8303 const ID: u32 = 386u32;
8304 const NAME: &'static str = "CAN_FRAME";
8305 const EXTRA_CRC: u8 = 132u8;
8306 const ENCODED_LEN: usize = 16usize;
8307 fn deser(
8308 _version: MavlinkVersion,
8309 __input: &[u8],
8310 ) -> Result<Self, ::mavlink_core::error::ParserError> {
8311 let avail_len = __input.len();
8312 let mut payload_buf = [0; Self::ENCODED_LEN];
8313 let mut buf = if avail_len < Self::ENCODED_LEN {
8314 payload_buf[0..avail_len].copy_from_slice(__input);
8315 Bytes::new(&payload_buf)
8316 } else {
8317 Bytes::new(__input)
8318 };
8319 let mut __struct = Self::default();
8320 __struct.id = buf.get_u32_le();
8321 __struct.target_system = buf.get_u8();
8322 __struct.target_component = buf.get_u8();
8323 __struct.bus = buf.get_u8();
8324 __struct.len = buf.get_u8();
8325 for v in &mut __struct.data {
8326 let val = buf.get_u8();
8327 *v = val;
8328 }
8329 Ok(__struct)
8330 }
8331 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
8332 let mut __tmp = BytesMut::new(bytes);
8333 #[allow(clippy::absurd_extreme_comparisons)]
8334 #[allow(unused_comparisons)]
8335 if __tmp.remaining() < Self::ENCODED_LEN {
8336 panic!(
8337 "buffer is too small (need {} bytes, but got {})",
8338 Self::ENCODED_LEN,
8339 __tmp.remaining(),
8340 )
8341 }
8342 __tmp.put_u32_le(self.id);
8343 __tmp.put_u8(self.target_system);
8344 __tmp.put_u8(self.target_component);
8345 __tmp.put_u8(self.bus);
8346 __tmp.put_u8(self.len);
8347 for val in &self.data {
8348 __tmp.put_u8(*val);
8349 }
8350 if matches!(version, MavlinkVersion::V2) {
8351 let len = __tmp.len();
8352 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
8353 } else {
8354 __tmp.len()
8355 }
8356 }
8357}
8358#[doc = "Configure cellular modems. This message is re-emitted as an acknowledgement by the modem. The message may also be explicitly requested using MAV_CMD_REQUEST_MESSAGE."]
8359#[doc = ""]
8360#[doc = "ID: 336"]
8361#[derive(Debug, Clone, PartialEq)]
8362#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
8363#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
8364#[cfg_attr(feature = "ts", derive(TS))]
8365#[cfg_attr(feature = "ts", ts(export))]
8366pub struct CELLULAR_CONFIG_DATA {
8367 #[doc = "Enable/disable LTE. 0: setting unchanged, 1: disabled, 2: enabled. Current setting when sent back as a response."]
8368 pub enable_lte: u8,
8369 #[doc = "Enable/disable PIN on the SIM card. 0: setting unchanged, 1: disabled, 2: enabled. Current setting when sent back as a response."]
8370 pub enable_pin: u8,
8371 #[doc = "PIN sent to the SIM card. Blank when PIN is disabled. Empty when message is sent back as a response."]
8372 #[cfg_attr(feature = "ts", ts(type = "string"))]
8373 pub pin: CharArray<16>,
8374 #[doc = "New PIN when changing the PIN. Blank to leave it unchanged. Empty when message is sent back as a response."]
8375 #[cfg_attr(feature = "ts", ts(type = "string"))]
8376 pub new_pin: CharArray<16>,
8377 #[doc = "Name of the cellular APN. Blank to leave it unchanged. Current APN when sent back as a response."]
8378 #[cfg_attr(feature = "ts", ts(type = "string"))]
8379 pub apn: CharArray<32>,
8380 #[doc = "Required PUK code in case the user failed to authenticate 3 times with the PIN. Empty when message is sent back as a response."]
8381 #[cfg_attr(feature = "ts", ts(type = "string"))]
8382 pub puk: CharArray<16>,
8383 #[doc = "Enable/disable roaming. 0: setting unchanged, 1: disabled, 2: enabled. Current setting when sent back as a response."]
8384 pub roaming: u8,
8385 #[doc = "Message acceptance response (sent back to GS)."]
8386 pub response: CellularConfigResponse,
8387}
8388impl CELLULAR_CONFIG_DATA {
8389 pub const ENCODED_LEN: usize = 84usize;
8390 pub const DEFAULT: Self = Self {
8391 enable_lte: 0_u8,
8392 enable_pin: 0_u8,
8393 pin: CharArray::new([0_u8; 16usize]),
8394 new_pin: CharArray::new([0_u8; 16usize]),
8395 apn: CharArray::new([0_u8; 32usize]),
8396 puk: CharArray::new([0_u8; 16usize]),
8397 roaming: 0_u8,
8398 response: CellularConfigResponse::DEFAULT,
8399 };
8400 #[cfg(feature = "arbitrary")]
8401 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
8402 use arbitrary::{Arbitrary, Unstructured};
8403 let mut buf = [0u8; 1024];
8404 rng.fill_bytes(&mut buf);
8405 let mut unstructured = Unstructured::new(&buf);
8406 Self::arbitrary(&mut unstructured).unwrap_or_default()
8407 }
8408}
8409impl Default for CELLULAR_CONFIG_DATA {
8410 fn default() -> Self {
8411 Self::DEFAULT.clone()
8412 }
8413}
8414impl MessageData for CELLULAR_CONFIG_DATA {
8415 type Message = MavMessage;
8416 const ID: u32 = 336u32;
8417 const NAME: &'static str = "CELLULAR_CONFIG";
8418 const EXTRA_CRC: u8 = 245u8;
8419 const ENCODED_LEN: usize = 84usize;
8420 fn deser(
8421 _version: MavlinkVersion,
8422 __input: &[u8],
8423 ) -> Result<Self, ::mavlink_core::error::ParserError> {
8424 let avail_len = __input.len();
8425 let mut payload_buf = [0; Self::ENCODED_LEN];
8426 let mut buf = if avail_len < Self::ENCODED_LEN {
8427 payload_buf[0..avail_len].copy_from_slice(__input);
8428 Bytes::new(&payload_buf)
8429 } else {
8430 Bytes::new(__input)
8431 };
8432 let mut __struct = Self::default();
8433 __struct.enable_lte = buf.get_u8();
8434 __struct.enable_pin = buf.get_u8();
8435 let mut tmp = [0_u8; 16usize];
8436 for v in &mut tmp {
8437 *v = buf.get_u8();
8438 }
8439 __struct.pin = CharArray::new(tmp);
8440 let mut tmp = [0_u8; 16usize];
8441 for v in &mut tmp {
8442 *v = buf.get_u8();
8443 }
8444 __struct.new_pin = CharArray::new(tmp);
8445 let mut tmp = [0_u8; 32usize];
8446 for v in &mut tmp {
8447 *v = buf.get_u8();
8448 }
8449 __struct.apn = CharArray::new(tmp);
8450 let mut tmp = [0_u8; 16usize];
8451 for v in &mut tmp {
8452 *v = buf.get_u8();
8453 }
8454 __struct.puk = CharArray::new(tmp);
8455 __struct.roaming = buf.get_u8();
8456 let tmp = buf.get_u8();
8457 __struct.response =
8458 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
8459 enum_type: "CellularConfigResponse",
8460 value: tmp as u64,
8461 })?;
8462 Ok(__struct)
8463 }
8464 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
8465 let mut __tmp = BytesMut::new(bytes);
8466 #[allow(clippy::absurd_extreme_comparisons)]
8467 #[allow(unused_comparisons)]
8468 if __tmp.remaining() < Self::ENCODED_LEN {
8469 panic!(
8470 "buffer is too small (need {} bytes, but got {})",
8471 Self::ENCODED_LEN,
8472 __tmp.remaining(),
8473 )
8474 }
8475 __tmp.put_u8(self.enable_lte);
8476 __tmp.put_u8(self.enable_pin);
8477 for val in &self.pin {
8478 __tmp.put_u8(*val);
8479 }
8480 for val in &self.new_pin {
8481 __tmp.put_u8(*val);
8482 }
8483 for val in &self.apn {
8484 __tmp.put_u8(*val);
8485 }
8486 for val in &self.puk {
8487 __tmp.put_u8(*val);
8488 }
8489 __tmp.put_u8(self.roaming);
8490 __tmp.put_u8(self.response as u8);
8491 if matches!(version, MavlinkVersion::V2) {
8492 let len = __tmp.len();
8493 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
8494 } else {
8495 __tmp.len()
8496 }
8497 }
8498}
8499#[doc = "Report current used cellular network status."]
8500#[doc = ""]
8501#[doc = "ID: 334"]
8502#[derive(Debug, Clone, PartialEq)]
8503#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
8504#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
8505#[cfg_attr(feature = "ts", derive(TS))]
8506#[cfg_attr(feature = "ts", ts(export))]
8507pub struct CELLULAR_STATUS_DATA {
8508 #[doc = "Mobile country code. If unknown, set to UINT16_MAX"]
8509 pub mcc: u16,
8510 #[doc = "Mobile network code. If unknown, set to UINT16_MAX"]
8511 pub mnc: u16,
8512 #[doc = "Location area code. If unknown, set to 0"]
8513 pub lac: u16,
8514 #[doc = "Cellular modem status"]
8515 pub status: CellularStatusFlag,
8516 #[doc = "Failure reason when status in in CELLULAR_STATUS_FLAG_FAILED"]
8517 pub failure_reason: CellularNetworkFailedReason,
8518 #[doc = "Cellular network radio type: gsm, cdma, lte..."]
8519 pub mavtype: CellularNetworkRadioType,
8520 #[doc = "Signal quality in percent. If unknown, set to UINT8_MAX"]
8521 pub quality: u8,
8522}
8523impl CELLULAR_STATUS_DATA {
8524 pub const ENCODED_LEN: usize = 10usize;
8525 pub const DEFAULT: Self = Self {
8526 mcc: 0_u16,
8527 mnc: 0_u16,
8528 lac: 0_u16,
8529 status: CellularStatusFlag::DEFAULT,
8530 failure_reason: CellularNetworkFailedReason::DEFAULT,
8531 mavtype: CellularNetworkRadioType::DEFAULT,
8532 quality: 0_u8,
8533 };
8534 #[cfg(feature = "arbitrary")]
8535 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
8536 use arbitrary::{Arbitrary, Unstructured};
8537 let mut buf = [0u8; 1024];
8538 rng.fill_bytes(&mut buf);
8539 let mut unstructured = Unstructured::new(&buf);
8540 Self::arbitrary(&mut unstructured).unwrap_or_default()
8541 }
8542}
8543impl Default for CELLULAR_STATUS_DATA {
8544 fn default() -> Self {
8545 Self::DEFAULT.clone()
8546 }
8547}
8548impl MessageData for CELLULAR_STATUS_DATA {
8549 type Message = MavMessage;
8550 const ID: u32 = 334u32;
8551 const NAME: &'static str = "CELLULAR_STATUS";
8552 const EXTRA_CRC: u8 = 72u8;
8553 const ENCODED_LEN: usize = 10usize;
8554 fn deser(
8555 _version: MavlinkVersion,
8556 __input: &[u8],
8557 ) -> Result<Self, ::mavlink_core::error::ParserError> {
8558 let avail_len = __input.len();
8559 let mut payload_buf = [0; Self::ENCODED_LEN];
8560 let mut buf = if avail_len < Self::ENCODED_LEN {
8561 payload_buf[0..avail_len].copy_from_slice(__input);
8562 Bytes::new(&payload_buf)
8563 } else {
8564 Bytes::new(__input)
8565 };
8566 let mut __struct = Self::default();
8567 __struct.mcc = buf.get_u16_le();
8568 __struct.mnc = buf.get_u16_le();
8569 __struct.lac = buf.get_u16_le();
8570 let tmp = buf.get_u8();
8571 __struct.status =
8572 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
8573 enum_type: "CellularStatusFlag",
8574 value: tmp as u64,
8575 })?;
8576 let tmp = buf.get_u8();
8577 __struct.failure_reason =
8578 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
8579 enum_type: "CellularNetworkFailedReason",
8580 value: tmp as u64,
8581 })?;
8582 let tmp = buf.get_u8();
8583 __struct.mavtype =
8584 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
8585 enum_type: "CellularNetworkRadioType",
8586 value: tmp as u64,
8587 })?;
8588 __struct.quality = buf.get_u8();
8589 Ok(__struct)
8590 }
8591 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
8592 let mut __tmp = BytesMut::new(bytes);
8593 #[allow(clippy::absurd_extreme_comparisons)]
8594 #[allow(unused_comparisons)]
8595 if __tmp.remaining() < Self::ENCODED_LEN {
8596 panic!(
8597 "buffer is too small (need {} bytes, but got {})",
8598 Self::ENCODED_LEN,
8599 __tmp.remaining(),
8600 )
8601 }
8602 __tmp.put_u16_le(self.mcc);
8603 __tmp.put_u16_le(self.mnc);
8604 __tmp.put_u16_le(self.lac);
8605 __tmp.put_u8(self.status as u8);
8606 __tmp.put_u8(self.failure_reason as u8);
8607 __tmp.put_u8(self.mavtype as u8);
8608 __tmp.put_u8(self.quality);
8609 if matches!(version, MavlinkVersion::V2) {
8610 let len = __tmp.len();
8611 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
8612 } else {
8613 __tmp.len()
8614 }
8615 }
8616}
8617#[doc = "Request to control this MAV."]
8618#[doc = ""]
8619#[doc = "ID: 5"]
8620#[derive(Debug, Clone, PartialEq)]
8621#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
8622#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
8623#[cfg_attr(feature = "ts", derive(TS))]
8624#[cfg_attr(feature = "ts", ts(export))]
8625pub struct CHANGE_OPERATOR_CONTROL_DATA {
8626 #[doc = "System the GCS requests control for"]
8627 pub target_system: u8,
8628 #[doc = "0: request control of this MAV, 1: Release control of this MAV"]
8629 pub control_request: u8,
8630 #[doc = "0: key as plaintext, 1-255: future, different hashing/encryption variants. The GCS should in general use the safest mode possible initially and then gradually move down the encryption level if it gets a NACK message indicating an encryption mismatch."]
8631 pub version: u8,
8632 #[doc = "Password / Key, depending on version plaintext or encrypted. 25 or less characters, NULL terminated. The characters may involve A-Z, a-z, 0-9, and \"!?,.-\""]
8633 #[cfg_attr(feature = "ts", ts(type = "string"))]
8634 pub passkey: CharArray<25>,
8635}
8636impl CHANGE_OPERATOR_CONTROL_DATA {
8637 pub const ENCODED_LEN: usize = 28usize;
8638 pub const DEFAULT: Self = Self {
8639 target_system: 0_u8,
8640 control_request: 0_u8,
8641 version: 0_u8,
8642 passkey: CharArray::new([0_u8; 25usize]),
8643 };
8644 #[cfg(feature = "arbitrary")]
8645 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
8646 use arbitrary::{Arbitrary, Unstructured};
8647 let mut buf = [0u8; 1024];
8648 rng.fill_bytes(&mut buf);
8649 let mut unstructured = Unstructured::new(&buf);
8650 Self::arbitrary(&mut unstructured).unwrap_or_default()
8651 }
8652}
8653impl Default for CHANGE_OPERATOR_CONTROL_DATA {
8654 fn default() -> Self {
8655 Self::DEFAULT.clone()
8656 }
8657}
8658impl MessageData for CHANGE_OPERATOR_CONTROL_DATA {
8659 type Message = MavMessage;
8660 const ID: u32 = 5u32;
8661 const NAME: &'static str = "CHANGE_OPERATOR_CONTROL";
8662 const EXTRA_CRC: u8 = 217u8;
8663 const ENCODED_LEN: usize = 28usize;
8664 fn deser(
8665 _version: MavlinkVersion,
8666 __input: &[u8],
8667 ) -> Result<Self, ::mavlink_core::error::ParserError> {
8668 let avail_len = __input.len();
8669 let mut payload_buf = [0; Self::ENCODED_LEN];
8670 let mut buf = if avail_len < Self::ENCODED_LEN {
8671 payload_buf[0..avail_len].copy_from_slice(__input);
8672 Bytes::new(&payload_buf)
8673 } else {
8674 Bytes::new(__input)
8675 };
8676 let mut __struct = Self::default();
8677 __struct.target_system = buf.get_u8();
8678 __struct.control_request = buf.get_u8();
8679 __struct.version = buf.get_u8();
8680 let mut tmp = [0_u8; 25usize];
8681 for v in &mut tmp {
8682 *v = buf.get_u8();
8683 }
8684 __struct.passkey = CharArray::new(tmp);
8685 Ok(__struct)
8686 }
8687 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
8688 let mut __tmp = BytesMut::new(bytes);
8689 #[allow(clippy::absurd_extreme_comparisons)]
8690 #[allow(unused_comparisons)]
8691 if __tmp.remaining() < Self::ENCODED_LEN {
8692 panic!(
8693 "buffer is too small (need {} bytes, but got {})",
8694 Self::ENCODED_LEN,
8695 __tmp.remaining(),
8696 )
8697 }
8698 __tmp.put_u8(self.target_system);
8699 __tmp.put_u8(self.control_request);
8700 __tmp.put_u8(self.version);
8701 for val in &self.passkey {
8702 __tmp.put_u8(*val);
8703 }
8704 if matches!(version, MavlinkVersion::V2) {
8705 let len = __tmp.len();
8706 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
8707 } else {
8708 __tmp.len()
8709 }
8710 }
8711}
8712#[doc = "Accept / deny control of this MAV."]
8713#[doc = ""]
8714#[doc = "ID: 6"]
8715#[derive(Debug, Clone, PartialEq)]
8716#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
8717#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
8718#[cfg_attr(feature = "ts", derive(TS))]
8719#[cfg_attr(feature = "ts", ts(export))]
8720pub struct CHANGE_OPERATOR_CONTROL_ACK_DATA {
8721 #[doc = "ID of the GCS this message"]
8722 pub gcs_system_id: u8,
8723 #[doc = "0: request control of this MAV, 1: Release control of this MAV"]
8724 pub control_request: u8,
8725 #[doc = "0: ACK, 1: NACK: Wrong passkey, 2: NACK: Unsupported passkey encryption method, 3: NACK: Already under control"]
8726 pub ack: u8,
8727}
8728impl CHANGE_OPERATOR_CONTROL_ACK_DATA {
8729 pub const ENCODED_LEN: usize = 3usize;
8730 pub const DEFAULT: Self = Self {
8731 gcs_system_id: 0_u8,
8732 control_request: 0_u8,
8733 ack: 0_u8,
8734 };
8735 #[cfg(feature = "arbitrary")]
8736 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
8737 use arbitrary::{Arbitrary, Unstructured};
8738 let mut buf = [0u8; 1024];
8739 rng.fill_bytes(&mut buf);
8740 let mut unstructured = Unstructured::new(&buf);
8741 Self::arbitrary(&mut unstructured).unwrap_or_default()
8742 }
8743}
8744impl Default for CHANGE_OPERATOR_CONTROL_ACK_DATA {
8745 fn default() -> Self {
8746 Self::DEFAULT.clone()
8747 }
8748}
8749impl MessageData for CHANGE_OPERATOR_CONTROL_ACK_DATA {
8750 type Message = MavMessage;
8751 const ID: u32 = 6u32;
8752 const NAME: &'static str = "CHANGE_OPERATOR_CONTROL_ACK";
8753 const EXTRA_CRC: u8 = 104u8;
8754 const ENCODED_LEN: usize = 3usize;
8755 fn deser(
8756 _version: MavlinkVersion,
8757 __input: &[u8],
8758 ) -> Result<Self, ::mavlink_core::error::ParserError> {
8759 let avail_len = __input.len();
8760 let mut payload_buf = [0; Self::ENCODED_LEN];
8761 let mut buf = if avail_len < Self::ENCODED_LEN {
8762 payload_buf[0..avail_len].copy_from_slice(__input);
8763 Bytes::new(&payload_buf)
8764 } else {
8765 Bytes::new(__input)
8766 };
8767 let mut __struct = Self::default();
8768 __struct.gcs_system_id = buf.get_u8();
8769 __struct.control_request = buf.get_u8();
8770 __struct.ack = buf.get_u8();
8771 Ok(__struct)
8772 }
8773 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
8774 let mut __tmp = BytesMut::new(bytes);
8775 #[allow(clippy::absurd_extreme_comparisons)]
8776 #[allow(unused_comparisons)]
8777 if __tmp.remaining() < Self::ENCODED_LEN {
8778 panic!(
8779 "buffer is too small (need {} bytes, but got {})",
8780 Self::ENCODED_LEN,
8781 __tmp.remaining(),
8782 )
8783 }
8784 __tmp.put_u8(self.gcs_system_id);
8785 __tmp.put_u8(self.control_request);
8786 __tmp.put_u8(self.ack);
8787 if matches!(version, MavlinkVersion::V2) {
8788 let len = __tmp.len();
8789 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
8790 } else {
8791 __tmp.len()
8792 }
8793 }
8794}
8795#[doc = "Information about a potential collision."]
8796#[doc = ""]
8797#[doc = "ID: 247"]
8798#[derive(Debug, Clone, PartialEq)]
8799#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
8800#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
8801#[cfg_attr(feature = "ts", derive(TS))]
8802#[cfg_attr(feature = "ts", ts(export))]
8803pub struct COLLISION_DATA {
8804 #[doc = "Unique identifier, domain based on src field"]
8805 pub id: u32,
8806 #[doc = "Estimated time until collision occurs"]
8807 pub time_to_minimum_delta: f32,
8808 #[doc = "Closest vertical distance between vehicle and object"]
8809 pub altitude_minimum_delta: f32,
8810 #[doc = "Closest horizontal distance between vehicle and object"]
8811 pub horizontal_minimum_delta: f32,
8812 #[doc = "Collision data source"]
8813 pub src: MavCollisionSrc,
8814 #[doc = "Action that is being taken to avoid this collision"]
8815 pub action: MavCollisionAction,
8816 #[doc = "How concerned the aircraft is about this collision"]
8817 pub threat_level: MavCollisionThreatLevel,
8818}
8819impl COLLISION_DATA {
8820 pub const ENCODED_LEN: usize = 19usize;
8821 pub const DEFAULT: Self = Self {
8822 id: 0_u32,
8823 time_to_minimum_delta: 0.0_f32,
8824 altitude_minimum_delta: 0.0_f32,
8825 horizontal_minimum_delta: 0.0_f32,
8826 src: MavCollisionSrc::DEFAULT,
8827 action: MavCollisionAction::DEFAULT,
8828 threat_level: MavCollisionThreatLevel::DEFAULT,
8829 };
8830 #[cfg(feature = "arbitrary")]
8831 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
8832 use arbitrary::{Arbitrary, Unstructured};
8833 let mut buf = [0u8; 1024];
8834 rng.fill_bytes(&mut buf);
8835 let mut unstructured = Unstructured::new(&buf);
8836 Self::arbitrary(&mut unstructured).unwrap_or_default()
8837 }
8838}
8839impl Default for COLLISION_DATA {
8840 fn default() -> Self {
8841 Self::DEFAULT.clone()
8842 }
8843}
8844impl MessageData for COLLISION_DATA {
8845 type Message = MavMessage;
8846 const ID: u32 = 247u32;
8847 const NAME: &'static str = "COLLISION";
8848 const EXTRA_CRC: u8 = 81u8;
8849 const ENCODED_LEN: usize = 19usize;
8850 fn deser(
8851 _version: MavlinkVersion,
8852 __input: &[u8],
8853 ) -> Result<Self, ::mavlink_core::error::ParserError> {
8854 let avail_len = __input.len();
8855 let mut payload_buf = [0; Self::ENCODED_LEN];
8856 let mut buf = if avail_len < Self::ENCODED_LEN {
8857 payload_buf[0..avail_len].copy_from_slice(__input);
8858 Bytes::new(&payload_buf)
8859 } else {
8860 Bytes::new(__input)
8861 };
8862 let mut __struct = Self::default();
8863 __struct.id = buf.get_u32_le();
8864 __struct.time_to_minimum_delta = buf.get_f32_le();
8865 __struct.altitude_minimum_delta = buf.get_f32_le();
8866 __struct.horizontal_minimum_delta = buf.get_f32_le();
8867 let tmp = buf.get_u8();
8868 __struct.src =
8869 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
8870 enum_type: "MavCollisionSrc",
8871 value: tmp as u64,
8872 })?;
8873 let tmp = buf.get_u8();
8874 __struct.action =
8875 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
8876 enum_type: "MavCollisionAction",
8877 value: tmp as u64,
8878 })?;
8879 let tmp = buf.get_u8();
8880 __struct.threat_level =
8881 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
8882 enum_type: "MavCollisionThreatLevel",
8883 value: tmp as u64,
8884 })?;
8885 Ok(__struct)
8886 }
8887 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
8888 let mut __tmp = BytesMut::new(bytes);
8889 #[allow(clippy::absurd_extreme_comparisons)]
8890 #[allow(unused_comparisons)]
8891 if __tmp.remaining() < Self::ENCODED_LEN {
8892 panic!(
8893 "buffer is too small (need {} bytes, but got {})",
8894 Self::ENCODED_LEN,
8895 __tmp.remaining(),
8896 )
8897 }
8898 __tmp.put_u32_le(self.id);
8899 __tmp.put_f32_le(self.time_to_minimum_delta);
8900 __tmp.put_f32_le(self.altitude_minimum_delta);
8901 __tmp.put_f32_le(self.horizontal_minimum_delta);
8902 __tmp.put_u8(self.src as u8);
8903 __tmp.put_u8(self.action as u8);
8904 __tmp.put_u8(self.threat_level as u8);
8905 if matches!(version, MavlinkVersion::V2) {
8906 let len = __tmp.len();
8907 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
8908 } else {
8909 __tmp.len()
8910 }
8911 }
8912}
8913#[doc = "Report status of a command. Includes feedback whether the command was executed. The command microservice is documented at <https://mavlink.io/en/services/command.html>."]
8914#[doc = ""]
8915#[doc = "ID: 77"]
8916#[derive(Debug, Clone, PartialEq)]
8917#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
8918#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
8919#[cfg_attr(feature = "ts", derive(TS))]
8920#[cfg_attr(feature = "ts", ts(export))]
8921pub struct COMMAND_ACK_DATA {
8922 #[doc = "Command ID (of acknowledged command)."]
8923 pub command: MavCmd,
8924 #[doc = "Result of command."]
8925 pub result: MavResult,
8926 #[doc = "The progress percentage when result is MAV_RESULT_IN_PROGRESS. Values: [0-100], or UINT8_MAX if the progress is unknown."]
8927 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
8928 pub progress: u8,
8929 #[doc = "Additional result information. Can be set with a command-specific enum containing command-specific error reasons for why the command might be denied. If used, the associated enum must be documented in the corresponding MAV_CMD (this enum should have a 0 value to indicate \"unused\" or \"unknown\")."]
8930 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
8931 pub result_param2: i32,
8932 #[doc = "System ID of the target recipient. This is the ID of the system that sent the command for which this COMMAND_ACK is an acknowledgement."]
8933 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
8934 pub target_system: u8,
8935 #[doc = "Component ID of the target recipient. This is the ID of the system that sent the command for which this COMMAND_ACK is an acknowledgement."]
8936 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
8937 pub target_component: u8,
8938}
8939impl COMMAND_ACK_DATA {
8940 pub const ENCODED_LEN: usize = 10usize;
8941 pub const DEFAULT: Self = Self {
8942 command: MavCmd::DEFAULT,
8943 result: MavResult::DEFAULT,
8944 progress: 0_u8,
8945 result_param2: 0_i32,
8946 target_system: 0_u8,
8947 target_component: 0_u8,
8948 };
8949 #[cfg(feature = "arbitrary")]
8950 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
8951 use arbitrary::{Arbitrary, Unstructured};
8952 let mut buf = [0u8; 1024];
8953 rng.fill_bytes(&mut buf);
8954 let mut unstructured = Unstructured::new(&buf);
8955 Self::arbitrary(&mut unstructured).unwrap_or_default()
8956 }
8957}
8958impl Default for COMMAND_ACK_DATA {
8959 fn default() -> Self {
8960 Self::DEFAULT.clone()
8961 }
8962}
8963impl MessageData for COMMAND_ACK_DATA {
8964 type Message = MavMessage;
8965 const ID: u32 = 77u32;
8966 const NAME: &'static str = "COMMAND_ACK";
8967 const EXTRA_CRC: u8 = 143u8;
8968 const ENCODED_LEN: usize = 10usize;
8969 fn deser(
8970 _version: MavlinkVersion,
8971 __input: &[u8],
8972 ) -> Result<Self, ::mavlink_core::error::ParserError> {
8973 let avail_len = __input.len();
8974 let mut payload_buf = [0; Self::ENCODED_LEN];
8975 let mut buf = if avail_len < Self::ENCODED_LEN {
8976 payload_buf[0..avail_len].copy_from_slice(__input);
8977 Bytes::new(&payload_buf)
8978 } else {
8979 Bytes::new(__input)
8980 };
8981 let mut __struct = Self::default();
8982 let tmp = buf.get_u16_le();
8983 __struct.command = FromPrimitive::from_u16(tmp).ok_or(
8984 ::mavlink_core::error::ParserError::InvalidEnum {
8985 enum_type: "MavCmd",
8986 value: tmp as u64,
8987 },
8988 )?;
8989 let tmp = buf.get_u8();
8990 __struct.result =
8991 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
8992 enum_type: "MavResult",
8993 value: tmp as u64,
8994 })?;
8995 __struct.progress = buf.get_u8();
8996 __struct.result_param2 = buf.get_i32_le();
8997 __struct.target_system = buf.get_u8();
8998 __struct.target_component = buf.get_u8();
8999 Ok(__struct)
9000 }
9001 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
9002 let mut __tmp = BytesMut::new(bytes);
9003 #[allow(clippy::absurd_extreme_comparisons)]
9004 #[allow(unused_comparisons)]
9005 if __tmp.remaining() < Self::ENCODED_LEN {
9006 panic!(
9007 "buffer is too small (need {} bytes, but got {})",
9008 Self::ENCODED_LEN,
9009 __tmp.remaining(),
9010 )
9011 }
9012 __tmp.put_u16_le(self.command as u16);
9013 __tmp.put_u8(self.result as u8);
9014 if matches!(version, MavlinkVersion::V2) {
9015 __tmp.put_u8(self.progress);
9016 __tmp.put_i32_le(self.result_param2);
9017 __tmp.put_u8(self.target_system);
9018 __tmp.put_u8(self.target_component);
9019 let len = __tmp.len();
9020 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
9021 } else {
9022 __tmp.len()
9023 }
9024 }
9025}
9026#[doc = "Cancel a long running command. The target system should respond with a COMMAND_ACK to the original command with result=MAV_RESULT_CANCELLED if the long running process was cancelled. If it has already completed, the cancel action can be ignored. The cancel action can be retried until some sort of acknowledgement to the original command has been received. The command microservice is documented at <https://mavlink.io/en/services/command.html>."]
9027#[doc = ""]
9028#[doc = "ID: 80"]
9029#[derive(Debug, Clone, PartialEq)]
9030#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
9031#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
9032#[cfg_attr(feature = "ts", derive(TS))]
9033#[cfg_attr(feature = "ts", ts(export))]
9034pub struct COMMAND_CANCEL_DATA {
9035 #[doc = "Command ID (of command to cancel)."]
9036 pub command: MavCmd,
9037 #[doc = "System executing long running command. Should not be broadcast (0)."]
9038 pub target_system: u8,
9039 #[doc = "Component executing long running command."]
9040 pub target_component: u8,
9041}
9042impl COMMAND_CANCEL_DATA {
9043 pub const ENCODED_LEN: usize = 4usize;
9044 pub const DEFAULT: Self = Self {
9045 command: MavCmd::DEFAULT,
9046 target_system: 0_u8,
9047 target_component: 0_u8,
9048 };
9049 #[cfg(feature = "arbitrary")]
9050 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
9051 use arbitrary::{Arbitrary, Unstructured};
9052 let mut buf = [0u8; 1024];
9053 rng.fill_bytes(&mut buf);
9054 let mut unstructured = Unstructured::new(&buf);
9055 Self::arbitrary(&mut unstructured).unwrap_or_default()
9056 }
9057}
9058impl Default for COMMAND_CANCEL_DATA {
9059 fn default() -> Self {
9060 Self::DEFAULT.clone()
9061 }
9062}
9063impl MessageData for COMMAND_CANCEL_DATA {
9064 type Message = MavMessage;
9065 const ID: u32 = 80u32;
9066 const NAME: &'static str = "COMMAND_CANCEL";
9067 const EXTRA_CRC: u8 = 14u8;
9068 const ENCODED_LEN: usize = 4usize;
9069 fn deser(
9070 _version: MavlinkVersion,
9071 __input: &[u8],
9072 ) -> Result<Self, ::mavlink_core::error::ParserError> {
9073 let avail_len = __input.len();
9074 let mut payload_buf = [0; Self::ENCODED_LEN];
9075 let mut buf = if avail_len < Self::ENCODED_LEN {
9076 payload_buf[0..avail_len].copy_from_slice(__input);
9077 Bytes::new(&payload_buf)
9078 } else {
9079 Bytes::new(__input)
9080 };
9081 let mut __struct = Self::default();
9082 let tmp = buf.get_u16_le();
9083 __struct.command = FromPrimitive::from_u16(tmp).ok_or(
9084 ::mavlink_core::error::ParserError::InvalidEnum {
9085 enum_type: "MavCmd",
9086 value: tmp as u64,
9087 },
9088 )?;
9089 __struct.target_system = buf.get_u8();
9090 __struct.target_component = buf.get_u8();
9091 Ok(__struct)
9092 }
9093 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
9094 let mut __tmp = BytesMut::new(bytes);
9095 #[allow(clippy::absurd_extreme_comparisons)]
9096 #[allow(unused_comparisons)]
9097 if __tmp.remaining() < Self::ENCODED_LEN {
9098 panic!(
9099 "buffer is too small (need {} bytes, but got {})",
9100 Self::ENCODED_LEN,
9101 __tmp.remaining(),
9102 )
9103 }
9104 __tmp.put_u16_le(self.command as u16);
9105 __tmp.put_u8(self.target_system);
9106 __tmp.put_u8(self.target_component);
9107 if matches!(version, MavlinkVersion::V2) {
9108 let len = __tmp.len();
9109 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
9110 } else {
9111 __tmp.len()
9112 }
9113 }
9114}
9115#[doc = "Send a command with up to seven parameters to the MAV, where params 5 and 6 are integers and the other values are floats. This is preferred over COMMAND_LONG as it allows the MAV_FRAME to be specified for interpreting positional information, such as altitude. COMMAND_INT is also preferred when sending latitude and longitude data in params 5 and 6, as it allows for greater precision. Param 5 and 6 encode positional data as scaled integers, where the scaling depends on the actual command value. NaN or INT32_MAX may be used in float/integer params (respectively) to indicate optional/default values (e.g. to use the component's current latitude, yaw rather than a specific value). The command microservice is documented at <https://mavlink.io/en/services/command.html>."]
9116#[doc = ""]
9117#[doc = "ID: 75"]
9118#[derive(Debug, Clone, PartialEq)]
9119#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
9120#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
9121#[cfg_attr(feature = "ts", derive(TS))]
9122#[cfg_attr(feature = "ts", ts(export))]
9123pub struct COMMAND_INT_DATA {
9124 #[doc = "PARAM1, see MAV_CMD enum"]
9125 pub param1: f32,
9126 #[doc = "PARAM2, see MAV_CMD enum"]
9127 pub param2: f32,
9128 #[doc = "PARAM3, see MAV_CMD enum"]
9129 pub param3: f32,
9130 #[doc = "PARAM4, see MAV_CMD enum"]
9131 pub param4: f32,
9132 #[doc = "PARAM5 / local: x position in meters * 1e4, global: latitude in degrees * 10^7"]
9133 pub x: i32,
9134 #[doc = "PARAM6 / local: y position in meters * 1e4, global: longitude in degrees * 10^7"]
9135 pub y: i32,
9136 #[doc = "PARAM7 / z position: global: altitude in meters (relative or absolute, depending on frame)."]
9137 pub z: f32,
9138 #[doc = "The scheduled action for the mission item."]
9139 pub command: MavCmd,
9140 #[doc = "System ID"]
9141 pub target_system: u8,
9142 #[doc = "Component ID"]
9143 pub target_component: u8,
9144 #[doc = "The coordinate system of the COMMAND."]
9145 pub frame: MavFrame,
9146 #[doc = "Not used."]
9147 pub current: u8,
9148 #[doc = "Not used (set 0)."]
9149 pub autocontinue: u8,
9150}
9151impl COMMAND_INT_DATA {
9152 pub const ENCODED_LEN: usize = 35usize;
9153 pub const DEFAULT: Self = Self {
9154 param1: 0.0_f32,
9155 param2: 0.0_f32,
9156 param3: 0.0_f32,
9157 param4: 0.0_f32,
9158 x: 0_i32,
9159 y: 0_i32,
9160 z: 0.0_f32,
9161 command: MavCmd::DEFAULT,
9162 target_system: 0_u8,
9163 target_component: 0_u8,
9164 frame: MavFrame::DEFAULT,
9165 current: 0_u8,
9166 autocontinue: 0_u8,
9167 };
9168 #[cfg(feature = "arbitrary")]
9169 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
9170 use arbitrary::{Arbitrary, Unstructured};
9171 let mut buf = [0u8; 1024];
9172 rng.fill_bytes(&mut buf);
9173 let mut unstructured = Unstructured::new(&buf);
9174 Self::arbitrary(&mut unstructured).unwrap_or_default()
9175 }
9176}
9177impl Default for COMMAND_INT_DATA {
9178 fn default() -> Self {
9179 Self::DEFAULT.clone()
9180 }
9181}
9182impl MessageData for COMMAND_INT_DATA {
9183 type Message = MavMessage;
9184 const ID: u32 = 75u32;
9185 const NAME: &'static str = "COMMAND_INT";
9186 const EXTRA_CRC: u8 = 158u8;
9187 const ENCODED_LEN: usize = 35usize;
9188 fn deser(
9189 _version: MavlinkVersion,
9190 __input: &[u8],
9191 ) -> Result<Self, ::mavlink_core::error::ParserError> {
9192 let avail_len = __input.len();
9193 let mut payload_buf = [0; Self::ENCODED_LEN];
9194 let mut buf = if avail_len < Self::ENCODED_LEN {
9195 payload_buf[0..avail_len].copy_from_slice(__input);
9196 Bytes::new(&payload_buf)
9197 } else {
9198 Bytes::new(__input)
9199 };
9200 let mut __struct = Self::default();
9201 __struct.param1 = buf.get_f32_le();
9202 __struct.param2 = buf.get_f32_le();
9203 __struct.param3 = buf.get_f32_le();
9204 __struct.param4 = buf.get_f32_le();
9205 __struct.x = buf.get_i32_le();
9206 __struct.y = buf.get_i32_le();
9207 __struct.z = buf.get_f32_le();
9208 let tmp = buf.get_u16_le();
9209 __struct.command = FromPrimitive::from_u16(tmp).ok_or(
9210 ::mavlink_core::error::ParserError::InvalidEnum {
9211 enum_type: "MavCmd",
9212 value: tmp as u64,
9213 },
9214 )?;
9215 __struct.target_system = buf.get_u8();
9216 __struct.target_component = buf.get_u8();
9217 let tmp = buf.get_u8();
9218 __struct.frame =
9219 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
9220 enum_type: "MavFrame",
9221 value: tmp as u64,
9222 })?;
9223 __struct.current = buf.get_u8();
9224 __struct.autocontinue = buf.get_u8();
9225 Ok(__struct)
9226 }
9227 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
9228 let mut __tmp = BytesMut::new(bytes);
9229 #[allow(clippy::absurd_extreme_comparisons)]
9230 #[allow(unused_comparisons)]
9231 if __tmp.remaining() < Self::ENCODED_LEN {
9232 panic!(
9233 "buffer is too small (need {} bytes, but got {})",
9234 Self::ENCODED_LEN,
9235 __tmp.remaining(),
9236 )
9237 }
9238 __tmp.put_f32_le(self.param1);
9239 __tmp.put_f32_le(self.param2);
9240 __tmp.put_f32_le(self.param3);
9241 __tmp.put_f32_le(self.param4);
9242 __tmp.put_i32_le(self.x);
9243 __tmp.put_i32_le(self.y);
9244 __tmp.put_f32_le(self.z);
9245 __tmp.put_u16_le(self.command as u16);
9246 __tmp.put_u8(self.target_system);
9247 __tmp.put_u8(self.target_component);
9248 __tmp.put_u8(self.frame as u8);
9249 __tmp.put_u8(self.current);
9250 __tmp.put_u8(self.autocontinue);
9251 if matches!(version, MavlinkVersion::V2) {
9252 let len = __tmp.len();
9253 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
9254 } else {
9255 __tmp.len()
9256 }
9257 }
9258}
9259#[doc = "Send a command with up to seven parameters to the MAV. COMMAND_INT is generally preferred when sending MAV_CMD commands that include positional information; it offers higher precision and allows the MAV_FRAME to be specified (which may otherwise be ambiguous, particularly for altitude). The command microservice is documented at <https://mavlink.io/en/services/command.html>."]
9260#[doc = ""]
9261#[doc = "ID: 76"]
9262#[derive(Debug, Clone, PartialEq)]
9263#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
9264#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
9265#[cfg_attr(feature = "ts", derive(TS))]
9266#[cfg_attr(feature = "ts", ts(export))]
9267pub struct COMMAND_LONG_DATA {
9268 #[doc = "Parameter 1 (for the specific command)."]
9269 pub param1: f32,
9270 #[doc = "Parameter 2 (for the specific command)."]
9271 pub param2: f32,
9272 #[doc = "Parameter 3 (for the specific command)."]
9273 pub param3: f32,
9274 #[doc = "Parameter 4 (for the specific command)."]
9275 pub param4: f32,
9276 #[doc = "Parameter 5 (for the specific command)."]
9277 pub param5: f32,
9278 #[doc = "Parameter 6 (for the specific command)."]
9279 pub param6: f32,
9280 #[doc = "Parameter 7 (for the specific command)."]
9281 pub param7: f32,
9282 #[doc = "Command ID (of command to send)."]
9283 pub command: MavCmd,
9284 #[doc = "System which should execute the command"]
9285 pub target_system: u8,
9286 #[doc = "Component which should execute the command, 0 for all components"]
9287 pub target_component: u8,
9288 #[doc = "0: First transmission of this command. 1-255: Confirmation transmissions (e.g. for kill command)"]
9289 pub confirmation: u8,
9290}
9291impl COMMAND_LONG_DATA {
9292 pub const ENCODED_LEN: usize = 33usize;
9293 pub const DEFAULT: Self = Self {
9294 param1: 0.0_f32,
9295 param2: 0.0_f32,
9296 param3: 0.0_f32,
9297 param4: 0.0_f32,
9298 param5: 0.0_f32,
9299 param6: 0.0_f32,
9300 param7: 0.0_f32,
9301 command: MavCmd::DEFAULT,
9302 target_system: 0_u8,
9303 target_component: 0_u8,
9304 confirmation: 0_u8,
9305 };
9306 #[cfg(feature = "arbitrary")]
9307 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
9308 use arbitrary::{Arbitrary, Unstructured};
9309 let mut buf = [0u8; 1024];
9310 rng.fill_bytes(&mut buf);
9311 let mut unstructured = Unstructured::new(&buf);
9312 Self::arbitrary(&mut unstructured).unwrap_or_default()
9313 }
9314}
9315impl Default for COMMAND_LONG_DATA {
9316 fn default() -> Self {
9317 Self::DEFAULT.clone()
9318 }
9319}
9320impl MessageData for COMMAND_LONG_DATA {
9321 type Message = MavMessage;
9322 const ID: u32 = 76u32;
9323 const NAME: &'static str = "COMMAND_LONG";
9324 const EXTRA_CRC: u8 = 152u8;
9325 const ENCODED_LEN: usize = 33usize;
9326 fn deser(
9327 _version: MavlinkVersion,
9328 __input: &[u8],
9329 ) -> Result<Self, ::mavlink_core::error::ParserError> {
9330 let avail_len = __input.len();
9331 let mut payload_buf = [0; Self::ENCODED_LEN];
9332 let mut buf = if avail_len < Self::ENCODED_LEN {
9333 payload_buf[0..avail_len].copy_from_slice(__input);
9334 Bytes::new(&payload_buf)
9335 } else {
9336 Bytes::new(__input)
9337 };
9338 let mut __struct = Self::default();
9339 __struct.param1 = buf.get_f32_le();
9340 __struct.param2 = buf.get_f32_le();
9341 __struct.param3 = buf.get_f32_le();
9342 __struct.param4 = buf.get_f32_le();
9343 __struct.param5 = buf.get_f32_le();
9344 __struct.param6 = buf.get_f32_le();
9345 __struct.param7 = buf.get_f32_le();
9346 let tmp = buf.get_u16_le();
9347 __struct.command = FromPrimitive::from_u16(tmp).ok_or(
9348 ::mavlink_core::error::ParserError::InvalidEnum {
9349 enum_type: "MavCmd",
9350 value: tmp as u64,
9351 },
9352 )?;
9353 __struct.target_system = buf.get_u8();
9354 __struct.target_component = buf.get_u8();
9355 __struct.confirmation = buf.get_u8();
9356 Ok(__struct)
9357 }
9358 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
9359 let mut __tmp = BytesMut::new(bytes);
9360 #[allow(clippy::absurd_extreme_comparisons)]
9361 #[allow(unused_comparisons)]
9362 if __tmp.remaining() < Self::ENCODED_LEN {
9363 panic!(
9364 "buffer is too small (need {} bytes, but got {})",
9365 Self::ENCODED_LEN,
9366 __tmp.remaining(),
9367 )
9368 }
9369 __tmp.put_f32_le(self.param1);
9370 __tmp.put_f32_le(self.param2);
9371 __tmp.put_f32_le(self.param3);
9372 __tmp.put_f32_le(self.param4);
9373 __tmp.put_f32_le(self.param5);
9374 __tmp.put_f32_le(self.param6);
9375 __tmp.put_f32_le(self.param7);
9376 __tmp.put_u16_le(self.command as u16);
9377 __tmp.put_u8(self.target_system);
9378 __tmp.put_u8(self.target_component);
9379 __tmp.put_u8(self.confirmation);
9380 if matches!(version, MavlinkVersion::V2) {
9381 let len = __tmp.len();
9382 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
9383 } else {
9384 __tmp.len()
9385 }
9386 }
9387}
9388#[deprecated = " See `COMPONENT_METADATA` (Deprecated since 2022-04)"]
9389#[doc = "Component information message, which may be requested using MAV_CMD_REQUEST_MESSAGE."]
9390#[doc = ""]
9391#[doc = "ID: 395"]
9392#[derive(Debug, Clone, PartialEq)]
9393#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
9394#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
9395#[cfg_attr(feature = "ts", derive(TS))]
9396#[cfg_attr(feature = "ts", ts(export))]
9397pub struct COMPONENT_INFORMATION_DATA {
9398 #[doc = "Timestamp (time since system boot)."]
9399 pub time_boot_ms: u32,
9400 #[doc = "CRC32 of the general metadata file (general_metadata_uri)."]
9401 pub general_metadata_file_crc: u32,
9402 #[doc = "CRC32 of peripherals metadata file (peripherals_metadata_uri)."]
9403 pub peripherals_metadata_file_crc: u32,
9404 #[doc = "MAVLink FTP URI for the general metadata file (COMP_METADATA_TYPE_GENERAL), which may be compressed with xz. The file contains general component metadata, and may contain URI links for additional metadata (see COMP_METADATA_TYPE). The information is static from boot, and may be generated at compile time. The string needs to be zero terminated."]
9405 #[cfg_attr(feature = "ts", ts(type = "string"))]
9406 pub general_metadata_uri: CharArray<100>,
9407 #[doc = "(Optional) MAVLink FTP URI for the peripherals metadata file (COMP_METADATA_TYPE_PERIPHERALS), which may be compressed with xz. This contains data about \"attached components\" such as UAVCAN nodes. The peripherals are in a separate file because the information must be generated dynamically at runtime. The string needs to be zero terminated."]
9408 #[cfg_attr(feature = "ts", ts(type = "string"))]
9409 pub peripherals_metadata_uri: CharArray<100>,
9410}
9411impl COMPONENT_INFORMATION_DATA {
9412 pub const ENCODED_LEN: usize = 212usize;
9413 pub const DEFAULT: Self = Self {
9414 time_boot_ms: 0_u32,
9415 general_metadata_file_crc: 0_u32,
9416 peripherals_metadata_file_crc: 0_u32,
9417 general_metadata_uri: CharArray::new([0_u8; 100usize]),
9418 peripherals_metadata_uri: CharArray::new([0_u8; 100usize]),
9419 };
9420 #[cfg(feature = "arbitrary")]
9421 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
9422 use arbitrary::{Arbitrary, Unstructured};
9423 let mut buf = [0u8; 1024];
9424 rng.fill_bytes(&mut buf);
9425 let mut unstructured = Unstructured::new(&buf);
9426 Self::arbitrary(&mut unstructured).unwrap_or_default()
9427 }
9428}
9429impl Default for COMPONENT_INFORMATION_DATA {
9430 fn default() -> Self {
9431 Self::DEFAULT.clone()
9432 }
9433}
9434impl MessageData for COMPONENT_INFORMATION_DATA {
9435 type Message = MavMessage;
9436 const ID: u32 = 395u32;
9437 const NAME: &'static str = "COMPONENT_INFORMATION";
9438 const EXTRA_CRC: u8 = 0u8;
9439 const ENCODED_LEN: usize = 212usize;
9440 fn deser(
9441 _version: MavlinkVersion,
9442 __input: &[u8],
9443 ) -> Result<Self, ::mavlink_core::error::ParserError> {
9444 let avail_len = __input.len();
9445 let mut payload_buf = [0; Self::ENCODED_LEN];
9446 let mut buf = if avail_len < Self::ENCODED_LEN {
9447 payload_buf[0..avail_len].copy_from_slice(__input);
9448 Bytes::new(&payload_buf)
9449 } else {
9450 Bytes::new(__input)
9451 };
9452 let mut __struct = Self::default();
9453 __struct.time_boot_ms = buf.get_u32_le();
9454 __struct.general_metadata_file_crc = buf.get_u32_le();
9455 __struct.peripherals_metadata_file_crc = buf.get_u32_le();
9456 let mut tmp = [0_u8; 100usize];
9457 for v in &mut tmp {
9458 *v = buf.get_u8();
9459 }
9460 __struct.general_metadata_uri = CharArray::new(tmp);
9461 let mut tmp = [0_u8; 100usize];
9462 for v in &mut tmp {
9463 *v = buf.get_u8();
9464 }
9465 __struct.peripherals_metadata_uri = CharArray::new(tmp);
9466 Ok(__struct)
9467 }
9468 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
9469 let mut __tmp = BytesMut::new(bytes);
9470 #[allow(clippy::absurd_extreme_comparisons)]
9471 #[allow(unused_comparisons)]
9472 if __tmp.remaining() < Self::ENCODED_LEN {
9473 panic!(
9474 "buffer is too small (need {} bytes, but got {})",
9475 Self::ENCODED_LEN,
9476 __tmp.remaining(),
9477 )
9478 }
9479 __tmp.put_u32_le(self.time_boot_ms);
9480 __tmp.put_u32_le(self.general_metadata_file_crc);
9481 __tmp.put_u32_le(self.peripherals_metadata_file_crc);
9482 for val in &self.general_metadata_uri {
9483 __tmp.put_u8(*val);
9484 }
9485 for val in &self.peripherals_metadata_uri {
9486 __tmp.put_u8(*val);
9487 }
9488 if matches!(version, MavlinkVersion::V2) {
9489 let len = __tmp.len();
9490 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
9491 } else {
9492 __tmp.len()
9493 }
9494 }
9495}
9496#[doc = "Basic component information data. Should be requested using MAV_CMD_REQUEST_MESSAGE on startup, or when required."]
9497#[doc = ""]
9498#[doc = "ID: 396"]
9499#[derive(Debug, Clone, PartialEq)]
9500#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
9501#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
9502#[cfg_attr(feature = "ts", derive(TS))]
9503#[cfg_attr(feature = "ts", ts(export))]
9504pub struct COMPONENT_INFORMATION_BASIC_DATA {
9505 #[doc = "Component capability flags"]
9506 pub capabilities: MavProtocolCapability,
9507 #[doc = "Timestamp (time since system boot)."]
9508 pub time_boot_ms: u32,
9509 #[doc = "Date of manufacture as a UNIX Epoch time (since 1.1.1970) in seconds."]
9510 pub time_manufacture_s: u32,
9511 #[doc = "Name of the component vendor. Needs to be zero terminated. The field is optional and can be empty/all zeros."]
9512 #[cfg_attr(feature = "ts", ts(type = "string"))]
9513 pub vendor_name: CharArray<32>,
9514 #[doc = "Name of the component model. Needs to be zero terminated. The field is optional and can be empty/all zeros."]
9515 #[cfg_attr(feature = "ts", ts(type = "string"))]
9516 pub model_name: CharArray<32>,
9517 #[doc = "Software version. The recommended format is SEMVER: 'major.minor.patch' (any format may be used). The field must be zero terminated if it has a value. The field is optional and can be empty/all zeros."]
9518 #[cfg_attr(feature = "ts", ts(type = "string"))]
9519 pub software_version: CharArray<24>,
9520 #[doc = "Hardware version. The recommended format is SEMVER: 'major.minor.patch' (any format may be used). The field must be zero terminated if it has a value. The field is optional and can be empty/all zeros."]
9521 #[cfg_attr(feature = "ts", ts(type = "string"))]
9522 pub hardware_version: CharArray<24>,
9523 #[doc = "Hardware serial number. The field must be zero terminated if it has a value. The field is optional and can be empty/all zeros."]
9524 #[cfg_attr(feature = "ts", ts(type = "string"))]
9525 pub serial_number: CharArray<32>,
9526}
9527impl COMPONENT_INFORMATION_BASIC_DATA {
9528 pub const ENCODED_LEN: usize = 160usize;
9529 pub const DEFAULT: Self = Self {
9530 capabilities: MavProtocolCapability::DEFAULT,
9531 time_boot_ms: 0_u32,
9532 time_manufacture_s: 0_u32,
9533 vendor_name: CharArray::new([0_u8; 32usize]),
9534 model_name: CharArray::new([0_u8; 32usize]),
9535 software_version: CharArray::new([0_u8; 24usize]),
9536 hardware_version: CharArray::new([0_u8; 24usize]),
9537 serial_number: CharArray::new([0_u8; 32usize]),
9538 };
9539 #[cfg(feature = "arbitrary")]
9540 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
9541 use arbitrary::{Arbitrary, Unstructured};
9542 let mut buf = [0u8; 1024];
9543 rng.fill_bytes(&mut buf);
9544 let mut unstructured = Unstructured::new(&buf);
9545 Self::arbitrary(&mut unstructured).unwrap_or_default()
9546 }
9547}
9548impl Default for COMPONENT_INFORMATION_BASIC_DATA {
9549 fn default() -> Self {
9550 Self::DEFAULT.clone()
9551 }
9552}
9553impl MessageData for COMPONENT_INFORMATION_BASIC_DATA {
9554 type Message = MavMessage;
9555 const ID: u32 = 396u32;
9556 const NAME: &'static str = "COMPONENT_INFORMATION_BASIC";
9557 const EXTRA_CRC: u8 = 50u8;
9558 const ENCODED_LEN: usize = 160usize;
9559 fn deser(
9560 _version: MavlinkVersion,
9561 __input: &[u8],
9562 ) -> Result<Self, ::mavlink_core::error::ParserError> {
9563 let avail_len = __input.len();
9564 let mut payload_buf = [0; Self::ENCODED_LEN];
9565 let mut buf = if avail_len < Self::ENCODED_LEN {
9566 payload_buf[0..avail_len].copy_from_slice(__input);
9567 Bytes::new(&payload_buf)
9568 } else {
9569 Bytes::new(__input)
9570 };
9571 let mut __struct = Self::default();
9572 let tmp = buf.get_u64_le();
9573 __struct.capabilities = MavProtocolCapability::from_bits(
9574 tmp as <MavProtocolCapability as Flags>::Bits,
9575 )
9576 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
9577 flag_type: "MavProtocolCapability",
9578 value: tmp as u64,
9579 })?;
9580 __struct.time_boot_ms = buf.get_u32_le();
9581 __struct.time_manufacture_s = buf.get_u32_le();
9582 let mut tmp = [0_u8; 32usize];
9583 for v in &mut tmp {
9584 *v = buf.get_u8();
9585 }
9586 __struct.vendor_name = CharArray::new(tmp);
9587 let mut tmp = [0_u8; 32usize];
9588 for v in &mut tmp {
9589 *v = buf.get_u8();
9590 }
9591 __struct.model_name = CharArray::new(tmp);
9592 let mut tmp = [0_u8; 24usize];
9593 for v in &mut tmp {
9594 *v = buf.get_u8();
9595 }
9596 __struct.software_version = CharArray::new(tmp);
9597 let mut tmp = [0_u8; 24usize];
9598 for v in &mut tmp {
9599 *v = buf.get_u8();
9600 }
9601 __struct.hardware_version = CharArray::new(tmp);
9602 let mut tmp = [0_u8; 32usize];
9603 for v in &mut tmp {
9604 *v = buf.get_u8();
9605 }
9606 __struct.serial_number = CharArray::new(tmp);
9607 Ok(__struct)
9608 }
9609 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
9610 let mut __tmp = BytesMut::new(bytes);
9611 #[allow(clippy::absurd_extreme_comparisons)]
9612 #[allow(unused_comparisons)]
9613 if __tmp.remaining() < Self::ENCODED_LEN {
9614 panic!(
9615 "buffer is too small (need {} bytes, but got {})",
9616 Self::ENCODED_LEN,
9617 __tmp.remaining(),
9618 )
9619 }
9620 __tmp.put_u64_le(self.capabilities.bits() as u64);
9621 __tmp.put_u32_le(self.time_boot_ms);
9622 __tmp.put_u32_le(self.time_manufacture_s);
9623 for val in &self.vendor_name {
9624 __tmp.put_u8(*val);
9625 }
9626 for val in &self.model_name {
9627 __tmp.put_u8(*val);
9628 }
9629 for val in &self.software_version {
9630 __tmp.put_u8(*val);
9631 }
9632 for val in &self.hardware_version {
9633 __tmp.put_u8(*val);
9634 }
9635 for val in &self.serial_number {
9636 __tmp.put_u8(*val);
9637 }
9638 if matches!(version, MavlinkVersion::V2) {
9639 let len = __tmp.len();
9640 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
9641 } else {
9642 __tmp.len()
9643 }
9644 }
9645}
9646#[doc = "Component metadata message, which may be requested using MAV_CMD_REQUEST_MESSAGE. This contains the MAVLink FTP URI and CRC for the component's general metadata file. The file must be hosted on the component, and may be xz compressed. The file CRC can be used for file caching. The general metadata file can be read to get the locations of other metadata files (COMP_METADATA_TYPE) and translations, which may be hosted either on the vehicle or the internet. For more information see: <https://mavlink.io/en/services/component_information.html>. Note: Camera components should use CAMERA_INFORMATION instead, and autopilots may use both this message and AUTOPILOT_VERSION."]
9647#[doc = ""]
9648#[doc = "ID: 397"]
9649#[derive(Debug, Clone, PartialEq)]
9650#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
9651#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
9652#[cfg_attr(feature = "ts", derive(TS))]
9653#[cfg_attr(feature = "ts", ts(export))]
9654pub struct COMPONENT_METADATA_DATA {
9655 #[doc = "Timestamp (time since system boot)."]
9656 pub time_boot_ms: u32,
9657 #[doc = "CRC32 of the general metadata file."]
9658 pub file_crc: u32,
9659 #[doc = "MAVLink FTP URI for the general metadata file (COMP_METADATA_TYPE_GENERAL), which may be compressed with xz. The file contains general component metadata, and may contain URI links for additional metadata (see COMP_METADATA_TYPE). The information is static from boot, and may be generated at compile time. The string needs to be zero terminated."]
9660 #[cfg_attr(feature = "ts", ts(type = "string"))]
9661 pub uri: CharArray<100>,
9662}
9663impl COMPONENT_METADATA_DATA {
9664 pub const ENCODED_LEN: usize = 108usize;
9665 pub const DEFAULT: Self = Self {
9666 time_boot_ms: 0_u32,
9667 file_crc: 0_u32,
9668 uri: CharArray::new([0_u8; 100usize]),
9669 };
9670 #[cfg(feature = "arbitrary")]
9671 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
9672 use arbitrary::{Arbitrary, Unstructured};
9673 let mut buf = [0u8; 1024];
9674 rng.fill_bytes(&mut buf);
9675 let mut unstructured = Unstructured::new(&buf);
9676 Self::arbitrary(&mut unstructured).unwrap_or_default()
9677 }
9678}
9679impl Default for COMPONENT_METADATA_DATA {
9680 fn default() -> Self {
9681 Self::DEFAULT.clone()
9682 }
9683}
9684impl MessageData for COMPONENT_METADATA_DATA {
9685 type Message = MavMessage;
9686 const ID: u32 = 397u32;
9687 const NAME: &'static str = "COMPONENT_METADATA";
9688 const EXTRA_CRC: u8 = 182u8;
9689 const ENCODED_LEN: usize = 108usize;
9690 fn deser(
9691 _version: MavlinkVersion,
9692 __input: &[u8],
9693 ) -> Result<Self, ::mavlink_core::error::ParserError> {
9694 let avail_len = __input.len();
9695 let mut payload_buf = [0; Self::ENCODED_LEN];
9696 let mut buf = if avail_len < Self::ENCODED_LEN {
9697 payload_buf[0..avail_len].copy_from_slice(__input);
9698 Bytes::new(&payload_buf)
9699 } else {
9700 Bytes::new(__input)
9701 };
9702 let mut __struct = Self::default();
9703 __struct.time_boot_ms = buf.get_u32_le();
9704 __struct.file_crc = buf.get_u32_le();
9705 let mut tmp = [0_u8; 100usize];
9706 for v in &mut tmp {
9707 *v = buf.get_u8();
9708 }
9709 __struct.uri = CharArray::new(tmp);
9710 Ok(__struct)
9711 }
9712 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
9713 let mut __tmp = BytesMut::new(bytes);
9714 #[allow(clippy::absurd_extreme_comparisons)]
9715 #[allow(unused_comparisons)]
9716 if __tmp.remaining() < Self::ENCODED_LEN {
9717 panic!(
9718 "buffer is too small (need {} bytes, but got {})",
9719 Self::ENCODED_LEN,
9720 __tmp.remaining(),
9721 )
9722 }
9723 __tmp.put_u32_le(self.time_boot_ms);
9724 __tmp.put_u32_le(self.file_crc);
9725 for val in &self.uri {
9726 __tmp.put_u8(*val);
9727 }
9728 if matches!(version, MavlinkVersion::V2) {
9729 let len = __tmp.len();
9730 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
9731 } else {
9732 __tmp.len()
9733 }
9734 }
9735}
9736#[doc = "The smoothed, monotonic system state used to feed the control loops of the system."]
9737#[doc = ""]
9738#[doc = "ID: 146"]
9739#[derive(Debug, Clone, PartialEq)]
9740#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
9741#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
9742#[cfg_attr(feature = "ts", derive(TS))]
9743#[cfg_attr(feature = "ts", ts(export))]
9744pub struct CONTROL_SYSTEM_STATE_DATA {
9745 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
9746 pub time_usec: u64,
9747 #[doc = "X acceleration in body frame"]
9748 pub x_acc: f32,
9749 #[doc = "Y acceleration in body frame"]
9750 pub y_acc: f32,
9751 #[doc = "Z acceleration in body frame"]
9752 pub z_acc: f32,
9753 #[doc = "X velocity in body frame"]
9754 pub x_vel: f32,
9755 #[doc = "Y velocity in body frame"]
9756 pub y_vel: f32,
9757 #[doc = "Z velocity in body frame"]
9758 pub z_vel: f32,
9759 #[doc = "X position in local frame"]
9760 pub x_pos: f32,
9761 #[doc = "Y position in local frame"]
9762 pub y_pos: f32,
9763 #[doc = "Z position in local frame"]
9764 pub z_pos: f32,
9765 #[doc = "Airspeed, set to -1 if unknown"]
9766 pub airspeed: f32,
9767 #[doc = "Variance of body velocity estimate"]
9768 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
9769 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
9770 pub vel_variance: [f32; 3],
9771 #[doc = "Variance in local position"]
9772 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
9773 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
9774 pub pos_variance: [f32; 3],
9775 #[doc = "The attitude, represented as Quaternion"]
9776 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
9777 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
9778 pub q: [f32; 4],
9779 #[doc = "Angular rate in roll axis"]
9780 pub roll_rate: f32,
9781 #[doc = "Angular rate in pitch axis"]
9782 pub pitch_rate: f32,
9783 #[doc = "Angular rate in yaw axis"]
9784 pub yaw_rate: f32,
9785}
9786impl CONTROL_SYSTEM_STATE_DATA {
9787 pub const ENCODED_LEN: usize = 100usize;
9788 pub const DEFAULT: Self = Self {
9789 time_usec: 0_u64,
9790 x_acc: 0.0_f32,
9791 y_acc: 0.0_f32,
9792 z_acc: 0.0_f32,
9793 x_vel: 0.0_f32,
9794 y_vel: 0.0_f32,
9795 z_vel: 0.0_f32,
9796 x_pos: 0.0_f32,
9797 y_pos: 0.0_f32,
9798 z_pos: 0.0_f32,
9799 airspeed: 0.0_f32,
9800 vel_variance: [0.0_f32; 3usize],
9801 pos_variance: [0.0_f32; 3usize],
9802 q: [0.0_f32; 4usize],
9803 roll_rate: 0.0_f32,
9804 pitch_rate: 0.0_f32,
9805 yaw_rate: 0.0_f32,
9806 };
9807 #[cfg(feature = "arbitrary")]
9808 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
9809 use arbitrary::{Arbitrary, Unstructured};
9810 let mut buf = [0u8; 1024];
9811 rng.fill_bytes(&mut buf);
9812 let mut unstructured = Unstructured::new(&buf);
9813 Self::arbitrary(&mut unstructured).unwrap_or_default()
9814 }
9815}
9816impl Default for CONTROL_SYSTEM_STATE_DATA {
9817 fn default() -> Self {
9818 Self::DEFAULT.clone()
9819 }
9820}
9821impl MessageData for CONTROL_SYSTEM_STATE_DATA {
9822 type Message = MavMessage;
9823 const ID: u32 = 146u32;
9824 const NAME: &'static str = "CONTROL_SYSTEM_STATE";
9825 const EXTRA_CRC: u8 = 103u8;
9826 const ENCODED_LEN: usize = 100usize;
9827 fn deser(
9828 _version: MavlinkVersion,
9829 __input: &[u8],
9830 ) -> Result<Self, ::mavlink_core::error::ParserError> {
9831 let avail_len = __input.len();
9832 let mut payload_buf = [0; Self::ENCODED_LEN];
9833 let mut buf = if avail_len < Self::ENCODED_LEN {
9834 payload_buf[0..avail_len].copy_from_slice(__input);
9835 Bytes::new(&payload_buf)
9836 } else {
9837 Bytes::new(__input)
9838 };
9839 let mut __struct = Self::default();
9840 __struct.time_usec = buf.get_u64_le();
9841 __struct.x_acc = buf.get_f32_le();
9842 __struct.y_acc = buf.get_f32_le();
9843 __struct.z_acc = buf.get_f32_le();
9844 __struct.x_vel = buf.get_f32_le();
9845 __struct.y_vel = buf.get_f32_le();
9846 __struct.z_vel = buf.get_f32_le();
9847 __struct.x_pos = buf.get_f32_le();
9848 __struct.y_pos = buf.get_f32_le();
9849 __struct.z_pos = buf.get_f32_le();
9850 __struct.airspeed = buf.get_f32_le();
9851 for v in &mut __struct.vel_variance {
9852 let val = buf.get_f32_le();
9853 *v = val;
9854 }
9855 for v in &mut __struct.pos_variance {
9856 let val = buf.get_f32_le();
9857 *v = val;
9858 }
9859 for v in &mut __struct.q {
9860 let val = buf.get_f32_le();
9861 *v = val;
9862 }
9863 __struct.roll_rate = buf.get_f32_le();
9864 __struct.pitch_rate = buf.get_f32_le();
9865 __struct.yaw_rate = buf.get_f32_le();
9866 Ok(__struct)
9867 }
9868 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
9869 let mut __tmp = BytesMut::new(bytes);
9870 #[allow(clippy::absurd_extreme_comparisons)]
9871 #[allow(unused_comparisons)]
9872 if __tmp.remaining() < Self::ENCODED_LEN {
9873 panic!(
9874 "buffer is too small (need {} bytes, but got {})",
9875 Self::ENCODED_LEN,
9876 __tmp.remaining(),
9877 )
9878 }
9879 __tmp.put_u64_le(self.time_usec);
9880 __tmp.put_f32_le(self.x_acc);
9881 __tmp.put_f32_le(self.y_acc);
9882 __tmp.put_f32_le(self.z_acc);
9883 __tmp.put_f32_le(self.x_vel);
9884 __tmp.put_f32_le(self.y_vel);
9885 __tmp.put_f32_le(self.z_vel);
9886 __tmp.put_f32_le(self.x_pos);
9887 __tmp.put_f32_le(self.y_pos);
9888 __tmp.put_f32_le(self.z_pos);
9889 __tmp.put_f32_le(self.airspeed);
9890 for val in &self.vel_variance {
9891 __tmp.put_f32_le(*val);
9892 }
9893 for val in &self.pos_variance {
9894 __tmp.put_f32_le(*val);
9895 }
9896 for val in &self.q {
9897 __tmp.put_f32_le(*val);
9898 }
9899 __tmp.put_f32_le(self.roll_rate);
9900 __tmp.put_f32_le(self.pitch_rate);
9901 __tmp.put_f32_le(self.yaw_rate);
9902 if matches!(version, MavlinkVersion::V2) {
9903 let len = __tmp.len();
9904 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
9905 } else {
9906 __tmp.len()
9907 }
9908 }
9909}
9910#[doc = "Regular broadcast for the current latest event sequence number for a component. This is used to check for dropped events."]
9911#[doc = ""]
9912#[doc = "ID: 411"]
9913#[derive(Debug, Clone, PartialEq)]
9914#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
9915#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
9916#[cfg_attr(feature = "ts", derive(TS))]
9917#[cfg_attr(feature = "ts", ts(export))]
9918pub struct CURRENT_EVENT_SEQUENCE_DATA {
9919 #[doc = "Sequence number."]
9920 pub sequence: u16,
9921 #[doc = "Flag bitset."]
9922 pub flags: MavEventCurrentSequenceFlags,
9923}
9924impl CURRENT_EVENT_SEQUENCE_DATA {
9925 pub const ENCODED_LEN: usize = 3usize;
9926 pub const DEFAULT: Self = Self {
9927 sequence: 0_u16,
9928 flags: MavEventCurrentSequenceFlags::DEFAULT,
9929 };
9930 #[cfg(feature = "arbitrary")]
9931 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
9932 use arbitrary::{Arbitrary, Unstructured};
9933 let mut buf = [0u8; 1024];
9934 rng.fill_bytes(&mut buf);
9935 let mut unstructured = Unstructured::new(&buf);
9936 Self::arbitrary(&mut unstructured).unwrap_or_default()
9937 }
9938}
9939impl Default for CURRENT_EVENT_SEQUENCE_DATA {
9940 fn default() -> Self {
9941 Self::DEFAULT.clone()
9942 }
9943}
9944impl MessageData for CURRENT_EVENT_SEQUENCE_DATA {
9945 type Message = MavMessage;
9946 const ID: u32 = 411u32;
9947 const NAME: &'static str = "CURRENT_EVENT_SEQUENCE";
9948 const EXTRA_CRC: u8 = 106u8;
9949 const ENCODED_LEN: usize = 3usize;
9950 fn deser(
9951 _version: MavlinkVersion,
9952 __input: &[u8],
9953 ) -> Result<Self, ::mavlink_core::error::ParserError> {
9954 let avail_len = __input.len();
9955 let mut payload_buf = [0; Self::ENCODED_LEN];
9956 let mut buf = if avail_len < Self::ENCODED_LEN {
9957 payload_buf[0..avail_len].copy_from_slice(__input);
9958 Bytes::new(&payload_buf)
9959 } else {
9960 Bytes::new(__input)
9961 };
9962 let mut __struct = Self::default();
9963 __struct.sequence = buf.get_u16_le();
9964 let tmp = buf.get_u8();
9965 __struct.flags =
9966 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
9967 enum_type: "MavEventCurrentSequenceFlags",
9968 value: tmp as u64,
9969 })?;
9970 Ok(__struct)
9971 }
9972 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
9973 let mut __tmp = BytesMut::new(bytes);
9974 #[allow(clippy::absurd_extreme_comparisons)]
9975 #[allow(unused_comparisons)]
9976 if __tmp.remaining() < Self::ENCODED_LEN {
9977 panic!(
9978 "buffer is too small (need {} bytes, but got {})",
9979 Self::ENCODED_LEN,
9980 __tmp.remaining(),
9981 )
9982 }
9983 __tmp.put_u16_le(self.sequence);
9984 __tmp.put_u8(self.flags as u8);
9985 if matches!(version, MavlinkVersion::V2) {
9986 let len = __tmp.len();
9987 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
9988 } else {
9989 __tmp.len()
9990 }
9991 }
9992}
9993#[doc = "Get the current mode. This should be emitted on any mode change, and broadcast at low rate (nominally 0.5 Hz). It may be requested using MAV_CMD_REQUEST_MESSAGE. See <https://mavlink.io/en/services/standard_modes.html>."]
9994#[doc = ""]
9995#[doc = "ID: 436"]
9996#[derive(Debug, Clone, PartialEq)]
9997#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
9998#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
9999#[cfg_attr(feature = "ts", derive(TS))]
10000#[cfg_attr(feature = "ts", ts(export))]
10001pub struct CURRENT_MODE_DATA {
10002 #[doc = "A bitfield for use for autopilot-specific flags"]
10003 pub custom_mode: u32,
10004 #[doc = "The custom_mode of the mode that was last commanded by the user (for example, with MAV_CMD_DO_SET_STANDARD_MODE, MAV_CMD_DO_SET_MODE or via RC). This should usually be the same as custom_mode. It will be different if the vehicle is unable to enter the intended mode, or has left that mode due to a failsafe condition. 0 indicates the intended custom mode is unknown/not supplied"]
10005 pub intended_custom_mode: u32,
10006 #[doc = "Standard mode."]
10007 pub standard_mode: MavStandardMode,
10008}
10009impl CURRENT_MODE_DATA {
10010 pub const ENCODED_LEN: usize = 9usize;
10011 pub const DEFAULT: Self = Self {
10012 custom_mode: 0_u32,
10013 intended_custom_mode: 0_u32,
10014 standard_mode: MavStandardMode::DEFAULT,
10015 };
10016 #[cfg(feature = "arbitrary")]
10017 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
10018 use arbitrary::{Arbitrary, Unstructured};
10019 let mut buf = [0u8; 1024];
10020 rng.fill_bytes(&mut buf);
10021 let mut unstructured = Unstructured::new(&buf);
10022 Self::arbitrary(&mut unstructured).unwrap_or_default()
10023 }
10024}
10025impl Default for CURRENT_MODE_DATA {
10026 fn default() -> Self {
10027 Self::DEFAULT.clone()
10028 }
10029}
10030impl MessageData for CURRENT_MODE_DATA {
10031 type Message = MavMessage;
10032 const ID: u32 = 436u32;
10033 const NAME: &'static str = "CURRENT_MODE";
10034 const EXTRA_CRC: u8 = 193u8;
10035 const ENCODED_LEN: usize = 9usize;
10036 fn deser(
10037 _version: MavlinkVersion,
10038 __input: &[u8],
10039 ) -> Result<Self, ::mavlink_core::error::ParserError> {
10040 let avail_len = __input.len();
10041 let mut payload_buf = [0; Self::ENCODED_LEN];
10042 let mut buf = if avail_len < Self::ENCODED_LEN {
10043 payload_buf[0..avail_len].copy_from_slice(__input);
10044 Bytes::new(&payload_buf)
10045 } else {
10046 Bytes::new(__input)
10047 };
10048 let mut __struct = Self::default();
10049 __struct.custom_mode = buf.get_u32_le();
10050 __struct.intended_custom_mode = buf.get_u32_le();
10051 let tmp = buf.get_u8();
10052 __struct.standard_mode =
10053 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
10054 enum_type: "MavStandardMode",
10055 value: tmp as u64,
10056 })?;
10057 Ok(__struct)
10058 }
10059 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
10060 let mut __tmp = BytesMut::new(bytes);
10061 #[allow(clippy::absurd_extreme_comparisons)]
10062 #[allow(unused_comparisons)]
10063 if __tmp.remaining() < Self::ENCODED_LEN {
10064 panic!(
10065 "buffer is too small (need {} bytes, but got {})",
10066 Self::ENCODED_LEN,
10067 __tmp.remaining(),
10068 )
10069 }
10070 __tmp.put_u32_le(self.custom_mode);
10071 __tmp.put_u32_le(self.intended_custom_mode);
10072 __tmp.put_u8(self.standard_mode as u8);
10073 if matches!(version, MavlinkVersion::V2) {
10074 let len = __tmp.len();
10075 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
10076 } else {
10077 __tmp.len()
10078 }
10079 }
10080}
10081#[deprecated = " See `MESSAGE_INTERVAL` (Deprecated since 2015-08)"]
10082#[doc = "Data stream status information."]
10083#[doc = ""]
10084#[doc = "ID: 67"]
10085#[derive(Debug, Clone, PartialEq)]
10086#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
10087#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
10088#[cfg_attr(feature = "ts", derive(TS))]
10089#[cfg_attr(feature = "ts", ts(export))]
10090pub struct DATA_STREAM_DATA {
10091 #[doc = "The message rate"]
10092 pub message_rate: u16,
10093 #[doc = "The ID of the requested data stream"]
10094 pub stream_id: u8,
10095 #[doc = "1 stream is enabled, 0 stream is stopped."]
10096 pub on_off: u8,
10097}
10098impl DATA_STREAM_DATA {
10099 pub const ENCODED_LEN: usize = 4usize;
10100 pub const DEFAULT: Self = Self {
10101 message_rate: 0_u16,
10102 stream_id: 0_u8,
10103 on_off: 0_u8,
10104 };
10105 #[cfg(feature = "arbitrary")]
10106 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
10107 use arbitrary::{Arbitrary, Unstructured};
10108 let mut buf = [0u8; 1024];
10109 rng.fill_bytes(&mut buf);
10110 let mut unstructured = Unstructured::new(&buf);
10111 Self::arbitrary(&mut unstructured).unwrap_or_default()
10112 }
10113}
10114impl Default for DATA_STREAM_DATA {
10115 fn default() -> Self {
10116 Self::DEFAULT.clone()
10117 }
10118}
10119impl MessageData for DATA_STREAM_DATA {
10120 type Message = MavMessage;
10121 const ID: u32 = 67u32;
10122 const NAME: &'static str = "DATA_STREAM";
10123 const EXTRA_CRC: u8 = 21u8;
10124 const ENCODED_LEN: usize = 4usize;
10125 fn deser(
10126 _version: MavlinkVersion,
10127 __input: &[u8],
10128 ) -> Result<Self, ::mavlink_core::error::ParserError> {
10129 let avail_len = __input.len();
10130 let mut payload_buf = [0; Self::ENCODED_LEN];
10131 let mut buf = if avail_len < Self::ENCODED_LEN {
10132 payload_buf[0..avail_len].copy_from_slice(__input);
10133 Bytes::new(&payload_buf)
10134 } else {
10135 Bytes::new(__input)
10136 };
10137 let mut __struct = Self::default();
10138 __struct.message_rate = buf.get_u16_le();
10139 __struct.stream_id = buf.get_u8();
10140 __struct.on_off = buf.get_u8();
10141 Ok(__struct)
10142 }
10143 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
10144 let mut __tmp = BytesMut::new(bytes);
10145 #[allow(clippy::absurd_extreme_comparisons)]
10146 #[allow(unused_comparisons)]
10147 if __tmp.remaining() < Self::ENCODED_LEN {
10148 panic!(
10149 "buffer is too small (need {} bytes, but got {})",
10150 Self::ENCODED_LEN,
10151 __tmp.remaining(),
10152 )
10153 }
10154 __tmp.put_u16_le(self.message_rate);
10155 __tmp.put_u8(self.stream_id);
10156 __tmp.put_u8(self.on_off);
10157 if matches!(version, MavlinkVersion::V2) {
10158 let len = __tmp.len();
10159 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
10160 } else {
10161 __tmp.len()
10162 }
10163 }
10164}
10165#[doc = "Handshake message to initiate, control and stop image streaming when using the Image Transmission Protocol: <https://mavlink.io/en/services/image_transmission.html>."]
10166#[doc = ""]
10167#[doc = "ID: 130"]
10168#[derive(Debug, Clone, PartialEq)]
10169#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
10170#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
10171#[cfg_attr(feature = "ts", derive(TS))]
10172#[cfg_attr(feature = "ts", ts(export))]
10173pub struct DATA_TRANSMISSION_HANDSHAKE_DATA {
10174 #[doc = "total data size (set on ACK only)."]
10175 pub size: u32,
10176 #[doc = "Width of a matrix or image."]
10177 pub width: u16,
10178 #[doc = "Height of a matrix or image."]
10179 pub height: u16,
10180 #[doc = "Number of packets being sent (set on ACK only)."]
10181 pub packets: u16,
10182 #[doc = "Type of requested/acknowledged data."]
10183 pub mavtype: MavlinkDataStreamType,
10184 #[doc = "Payload size per packet (normally 253 byte, see DATA field size in message ENCAPSULATED_DATA) (set on ACK only)."]
10185 pub payload: u8,
10186 #[doc = "JPEG quality. Values: [1-100]."]
10187 pub jpg_quality: u8,
10188}
10189impl DATA_TRANSMISSION_HANDSHAKE_DATA {
10190 pub const ENCODED_LEN: usize = 13usize;
10191 pub const DEFAULT: Self = Self {
10192 size: 0_u32,
10193 width: 0_u16,
10194 height: 0_u16,
10195 packets: 0_u16,
10196 mavtype: MavlinkDataStreamType::DEFAULT,
10197 payload: 0_u8,
10198 jpg_quality: 0_u8,
10199 };
10200 #[cfg(feature = "arbitrary")]
10201 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
10202 use arbitrary::{Arbitrary, Unstructured};
10203 let mut buf = [0u8; 1024];
10204 rng.fill_bytes(&mut buf);
10205 let mut unstructured = Unstructured::new(&buf);
10206 Self::arbitrary(&mut unstructured).unwrap_or_default()
10207 }
10208}
10209impl Default for DATA_TRANSMISSION_HANDSHAKE_DATA {
10210 fn default() -> Self {
10211 Self::DEFAULT.clone()
10212 }
10213}
10214impl MessageData for DATA_TRANSMISSION_HANDSHAKE_DATA {
10215 type Message = MavMessage;
10216 const ID: u32 = 130u32;
10217 const NAME: &'static str = "DATA_TRANSMISSION_HANDSHAKE";
10218 const EXTRA_CRC: u8 = 29u8;
10219 const ENCODED_LEN: usize = 13usize;
10220 fn deser(
10221 _version: MavlinkVersion,
10222 __input: &[u8],
10223 ) -> Result<Self, ::mavlink_core::error::ParserError> {
10224 let avail_len = __input.len();
10225 let mut payload_buf = [0; Self::ENCODED_LEN];
10226 let mut buf = if avail_len < Self::ENCODED_LEN {
10227 payload_buf[0..avail_len].copy_from_slice(__input);
10228 Bytes::new(&payload_buf)
10229 } else {
10230 Bytes::new(__input)
10231 };
10232 let mut __struct = Self::default();
10233 __struct.size = buf.get_u32_le();
10234 __struct.width = buf.get_u16_le();
10235 __struct.height = buf.get_u16_le();
10236 __struct.packets = buf.get_u16_le();
10237 let tmp = buf.get_u8();
10238 __struct.mavtype =
10239 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
10240 enum_type: "MavlinkDataStreamType",
10241 value: tmp as u64,
10242 })?;
10243 __struct.payload = buf.get_u8();
10244 __struct.jpg_quality = buf.get_u8();
10245 Ok(__struct)
10246 }
10247 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
10248 let mut __tmp = BytesMut::new(bytes);
10249 #[allow(clippy::absurd_extreme_comparisons)]
10250 #[allow(unused_comparisons)]
10251 if __tmp.remaining() < Self::ENCODED_LEN {
10252 panic!(
10253 "buffer is too small (need {} bytes, but got {})",
10254 Self::ENCODED_LEN,
10255 __tmp.remaining(),
10256 )
10257 }
10258 __tmp.put_u32_le(self.size);
10259 __tmp.put_u16_le(self.width);
10260 __tmp.put_u16_le(self.height);
10261 __tmp.put_u16_le(self.packets);
10262 __tmp.put_u8(self.mavtype as u8);
10263 __tmp.put_u8(self.payload);
10264 __tmp.put_u8(self.jpg_quality);
10265 if matches!(version, MavlinkVersion::V2) {
10266 let len = __tmp.len();
10267 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
10268 } else {
10269 __tmp.len()
10270 }
10271 }
10272}
10273#[doc = "Send a debug value. The index is used to discriminate between values. These values show up in the plot of QGroundControl as DEBUG N."]
10274#[doc = ""]
10275#[doc = "ID: 254"]
10276#[derive(Debug, Clone, PartialEq)]
10277#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
10278#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
10279#[cfg_attr(feature = "ts", derive(TS))]
10280#[cfg_attr(feature = "ts", ts(export))]
10281pub struct DEBUG_DATA {
10282 #[doc = "Timestamp (time since system boot)."]
10283 pub time_boot_ms: u32,
10284 #[doc = "DEBUG value"]
10285 pub value: f32,
10286 #[doc = "index of debug variable"]
10287 pub ind: u8,
10288}
10289impl DEBUG_DATA {
10290 pub const ENCODED_LEN: usize = 9usize;
10291 pub const DEFAULT: Self = Self {
10292 time_boot_ms: 0_u32,
10293 value: 0.0_f32,
10294 ind: 0_u8,
10295 };
10296 #[cfg(feature = "arbitrary")]
10297 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
10298 use arbitrary::{Arbitrary, Unstructured};
10299 let mut buf = [0u8; 1024];
10300 rng.fill_bytes(&mut buf);
10301 let mut unstructured = Unstructured::new(&buf);
10302 Self::arbitrary(&mut unstructured).unwrap_or_default()
10303 }
10304}
10305impl Default for DEBUG_DATA {
10306 fn default() -> Self {
10307 Self::DEFAULT.clone()
10308 }
10309}
10310impl MessageData for DEBUG_DATA {
10311 type Message = MavMessage;
10312 const ID: u32 = 254u32;
10313 const NAME: &'static str = "DEBUG";
10314 const EXTRA_CRC: u8 = 46u8;
10315 const ENCODED_LEN: usize = 9usize;
10316 fn deser(
10317 _version: MavlinkVersion,
10318 __input: &[u8],
10319 ) -> Result<Self, ::mavlink_core::error::ParserError> {
10320 let avail_len = __input.len();
10321 let mut payload_buf = [0; Self::ENCODED_LEN];
10322 let mut buf = if avail_len < Self::ENCODED_LEN {
10323 payload_buf[0..avail_len].copy_from_slice(__input);
10324 Bytes::new(&payload_buf)
10325 } else {
10326 Bytes::new(__input)
10327 };
10328 let mut __struct = Self::default();
10329 __struct.time_boot_ms = buf.get_u32_le();
10330 __struct.value = buf.get_f32_le();
10331 __struct.ind = buf.get_u8();
10332 Ok(__struct)
10333 }
10334 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
10335 let mut __tmp = BytesMut::new(bytes);
10336 #[allow(clippy::absurd_extreme_comparisons)]
10337 #[allow(unused_comparisons)]
10338 if __tmp.remaining() < Self::ENCODED_LEN {
10339 panic!(
10340 "buffer is too small (need {} bytes, but got {})",
10341 Self::ENCODED_LEN,
10342 __tmp.remaining(),
10343 )
10344 }
10345 __tmp.put_u32_le(self.time_boot_ms);
10346 __tmp.put_f32_le(self.value);
10347 __tmp.put_u8(self.ind);
10348 if matches!(version, MavlinkVersion::V2) {
10349 let len = __tmp.len();
10350 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
10351 } else {
10352 __tmp.len()
10353 }
10354 }
10355}
10356#[doc = "Large debug/prototyping array. The message uses the maximum available payload for data. The array_id and name fields are used to discriminate between messages in code and in user interfaces (respectively). Do not use in production code."]
10357#[doc = ""]
10358#[doc = "ID: 350"]
10359#[derive(Debug, Clone, PartialEq)]
10360#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
10361#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
10362#[cfg_attr(feature = "ts", derive(TS))]
10363#[cfg_attr(feature = "ts", ts(export))]
10364pub struct DEBUG_FLOAT_ARRAY_DATA {
10365 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
10366 pub time_usec: u64,
10367 #[doc = "Unique ID used to discriminate between arrays"]
10368 pub array_id: u16,
10369 #[doc = "Name, for human-friendly display in a Ground Control Station"]
10370 #[cfg_attr(feature = "ts", ts(type = "string"))]
10371 pub name: CharArray<10>,
10372 #[doc = "data"]
10373 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
10374 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
10375 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
10376 pub data: [f32; 58],
10377}
10378impl DEBUG_FLOAT_ARRAY_DATA {
10379 pub const ENCODED_LEN: usize = 252usize;
10380 pub const DEFAULT: Self = Self {
10381 time_usec: 0_u64,
10382 array_id: 0_u16,
10383 name: CharArray::new([0_u8; 10usize]),
10384 data: [0.0_f32; 58usize],
10385 };
10386 #[cfg(feature = "arbitrary")]
10387 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
10388 use arbitrary::{Arbitrary, Unstructured};
10389 let mut buf = [0u8; 1024];
10390 rng.fill_bytes(&mut buf);
10391 let mut unstructured = Unstructured::new(&buf);
10392 Self::arbitrary(&mut unstructured).unwrap_or_default()
10393 }
10394}
10395impl Default for DEBUG_FLOAT_ARRAY_DATA {
10396 fn default() -> Self {
10397 Self::DEFAULT.clone()
10398 }
10399}
10400impl MessageData for DEBUG_FLOAT_ARRAY_DATA {
10401 type Message = MavMessage;
10402 const ID: u32 = 350u32;
10403 const NAME: &'static str = "DEBUG_FLOAT_ARRAY";
10404 const EXTRA_CRC: u8 = 232u8;
10405 const ENCODED_LEN: usize = 252usize;
10406 fn deser(
10407 _version: MavlinkVersion,
10408 __input: &[u8],
10409 ) -> Result<Self, ::mavlink_core::error::ParserError> {
10410 let avail_len = __input.len();
10411 let mut payload_buf = [0; Self::ENCODED_LEN];
10412 let mut buf = if avail_len < Self::ENCODED_LEN {
10413 payload_buf[0..avail_len].copy_from_slice(__input);
10414 Bytes::new(&payload_buf)
10415 } else {
10416 Bytes::new(__input)
10417 };
10418 let mut __struct = Self::default();
10419 __struct.time_usec = buf.get_u64_le();
10420 __struct.array_id = buf.get_u16_le();
10421 let mut tmp = [0_u8; 10usize];
10422 for v in &mut tmp {
10423 *v = buf.get_u8();
10424 }
10425 __struct.name = CharArray::new(tmp);
10426 for v in &mut __struct.data {
10427 let val = buf.get_f32_le();
10428 *v = val;
10429 }
10430 Ok(__struct)
10431 }
10432 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
10433 let mut __tmp = BytesMut::new(bytes);
10434 #[allow(clippy::absurd_extreme_comparisons)]
10435 #[allow(unused_comparisons)]
10436 if __tmp.remaining() < Self::ENCODED_LEN {
10437 panic!(
10438 "buffer is too small (need {} bytes, but got {})",
10439 Self::ENCODED_LEN,
10440 __tmp.remaining(),
10441 )
10442 }
10443 __tmp.put_u64_le(self.time_usec);
10444 __tmp.put_u16_le(self.array_id);
10445 for val in &self.name {
10446 __tmp.put_u8(*val);
10447 }
10448 if matches!(version, MavlinkVersion::V2) {
10449 for val in &self.data {
10450 __tmp.put_f32_le(*val);
10451 }
10452 let len = __tmp.len();
10453 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
10454 } else {
10455 __tmp.len()
10456 }
10457 }
10458}
10459#[doc = "To debug something using a named 3D vector."]
10460#[doc = ""]
10461#[doc = "ID: 250"]
10462#[derive(Debug, Clone, PartialEq)]
10463#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
10464#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
10465#[cfg_attr(feature = "ts", derive(TS))]
10466#[cfg_attr(feature = "ts", ts(export))]
10467pub struct DEBUG_VECT_DATA {
10468 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
10469 pub time_usec: u64,
10470 #[doc = "x"]
10471 pub x: f32,
10472 #[doc = "y"]
10473 pub y: f32,
10474 #[doc = "z"]
10475 pub z: f32,
10476 #[doc = "Name"]
10477 #[cfg_attr(feature = "ts", ts(type = "string"))]
10478 pub name: CharArray<10>,
10479}
10480impl DEBUG_VECT_DATA {
10481 pub const ENCODED_LEN: usize = 30usize;
10482 pub const DEFAULT: Self = Self {
10483 time_usec: 0_u64,
10484 x: 0.0_f32,
10485 y: 0.0_f32,
10486 z: 0.0_f32,
10487 name: CharArray::new([0_u8; 10usize]),
10488 };
10489 #[cfg(feature = "arbitrary")]
10490 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
10491 use arbitrary::{Arbitrary, Unstructured};
10492 let mut buf = [0u8; 1024];
10493 rng.fill_bytes(&mut buf);
10494 let mut unstructured = Unstructured::new(&buf);
10495 Self::arbitrary(&mut unstructured).unwrap_or_default()
10496 }
10497}
10498impl Default for DEBUG_VECT_DATA {
10499 fn default() -> Self {
10500 Self::DEFAULT.clone()
10501 }
10502}
10503impl MessageData for DEBUG_VECT_DATA {
10504 type Message = MavMessage;
10505 const ID: u32 = 250u32;
10506 const NAME: &'static str = "DEBUG_VECT";
10507 const EXTRA_CRC: u8 = 49u8;
10508 const ENCODED_LEN: usize = 30usize;
10509 fn deser(
10510 _version: MavlinkVersion,
10511 __input: &[u8],
10512 ) -> Result<Self, ::mavlink_core::error::ParserError> {
10513 let avail_len = __input.len();
10514 let mut payload_buf = [0; Self::ENCODED_LEN];
10515 let mut buf = if avail_len < Self::ENCODED_LEN {
10516 payload_buf[0..avail_len].copy_from_slice(__input);
10517 Bytes::new(&payload_buf)
10518 } else {
10519 Bytes::new(__input)
10520 };
10521 let mut __struct = Self::default();
10522 __struct.time_usec = buf.get_u64_le();
10523 __struct.x = buf.get_f32_le();
10524 __struct.y = buf.get_f32_le();
10525 __struct.z = buf.get_f32_le();
10526 let mut tmp = [0_u8; 10usize];
10527 for v in &mut tmp {
10528 *v = buf.get_u8();
10529 }
10530 __struct.name = CharArray::new(tmp);
10531 Ok(__struct)
10532 }
10533 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
10534 let mut __tmp = BytesMut::new(bytes);
10535 #[allow(clippy::absurd_extreme_comparisons)]
10536 #[allow(unused_comparisons)]
10537 if __tmp.remaining() < Self::ENCODED_LEN {
10538 panic!(
10539 "buffer is too small (need {} bytes, but got {})",
10540 Self::ENCODED_LEN,
10541 __tmp.remaining(),
10542 )
10543 }
10544 __tmp.put_u64_le(self.time_usec);
10545 __tmp.put_f32_le(self.x);
10546 __tmp.put_f32_le(self.y);
10547 __tmp.put_f32_le(self.z);
10548 for val in &self.name {
10549 __tmp.put_u8(*val);
10550 }
10551 if matches!(version, MavlinkVersion::V2) {
10552 let len = __tmp.len();
10553 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
10554 } else {
10555 __tmp.len()
10556 }
10557 }
10558}
10559#[doc = "Distance sensor information for an onboard rangefinder."]
10560#[doc = ""]
10561#[doc = "ID: 132"]
10562#[derive(Debug, Clone, PartialEq)]
10563#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
10564#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
10565#[cfg_attr(feature = "ts", derive(TS))]
10566#[cfg_attr(feature = "ts", ts(export))]
10567pub struct DISTANCE_SENSOR_DATA {
10568 #[doc = "Timestamp (time since system boot)."]
10569 pub time_boot_ms: u32,
10570 #[doc = "Minimum distance the sensor can measure"]
10571 pub min_distance: u16,
10572 #[doc = "Maximum distance the sensor can measure"]
10573 pub max_distance: u16,
10574 #[doc = "Current distance reading"]
10575 pub current_distance: u16,
10576 #[doc = "Type of distance sensor."]
10577 pub mavtype: MavDistanceSensor,
10578 #[doc = "Onboard ID of the sensor"]
10579 pub id: u8,
10580 #[doc = "Direction the sensor faces. downward-facing: ROTATION_PITCH_270, upward-facing: ROTATION_PITCH_90, backward-facing: ROTATION_PITCH_180, forward-facing: ROTATION_NONE, left-facing: ROTATION_YAW_90, right-facing: ROTATION_YAW_270"]
10581 pub orientation: MavSensorOrientation,
10582 #[doc = "Measurement variance. Max standard deviation is 6cm. UINT8_MAX if unknown."]
10583 pub covariance: u8,
10584 #[doc = "Horizontal Field of View (angle) where the distance measurement is valid and the field of view is known. Otherwise this is set to 0."]
10585 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
10586 pub horizontal_fov: f32,
10587 #[doc = "Vertical Field of View (angle) where the distance measurement is valid and the field of view is known. Otherwise this is set to 0."]
10588 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
10589 pub vertical_fov: f32,
10590 #[doc = "Quaternion of the sensor orientation in vehicle body frame (w, x, y, z order, zero-rotation is 1, 0, 0, 0). Zero-rotation is along the vehicle body x-axis. This field is required if the orientation is set to MAV_SENSOR_ROTATION_CUSTOM. Set it to 0 if invalid.\""]
10591 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
10592 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
10593 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
10594 pub quaternion: [f32; 4],
10595 #[doc = "Signal quality of the sensor. Specific to each sensor type, representing the relation of the signal strength with the target reflectivity, distance, size or aspect, but normalised as a percentage. 0 = unknown/unset signal quality, 1 = invalid signal, 100 = perfect signal."]
10596 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
10597 pub signal_quality: u8,
10598}
10599impl DISTANCE_SENSOR_DATA {
10600 pub const ENCODED_LEN: usize = 39usize;
10601 pub const DEFAULT: Self = Self {
10602 time_boot_ms: 0_u32,
10603 min_distance: 0_u16,
10604 max_distance: 0_u16,
10605 current_distance: 0_u16,
10606 mavtype: MavDistanceSensor::DEFAULT,
10607 id: 0_u8,
10608 orientation: MavSensorOrientation::DEFAULT,
10609 covariance: 0_u8,
10610 horizontal_fov: 0.0_f32,
10611 vertical_fov: 0.0_f32,
10612 quaternion: [0.0_f32; 4usize],
10613 signal_quality: 0_u8,
10614 };
10615 #[cfg(feature = "arbitrary")]
10616 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
10617 use arbitrary::{Arbitrary, Unstructured};
10618 let mut buf = [0u8; 1024];
10619 rng.fill_bytes(&mut buf);
10620 let mut unstructured = Unstructured::new(&buf);
10621 Self::arbitrary(&mut unstructured).unwrap_or_default()
10622 }
10623}
10624impl Default for DISTANCE_SENSOR_DATA {
10625 fn default() -> Self {
10626 Self::DEFAULT.clone()
10627 }
10628}
10629impl MessageData for DISTANCE_SENSOR_DATA {
10630 type Message = MavMessage;
10631 const ID: u32 = 132u32;
10632 const NAME: &'static str = "DISTANCE_SENSOR";
10633 const EXTRA_CRC: u8 = 85u8;
10634 const ENCODED_LEN: usize = 39usize;
10635 fn deser(
10636 _version: MavlinkVersion,
10637 __input: &[u8],
10638 ) -> Result<Self, ::mavlink_core::error::ParserError> {
10639 let avail_len = __input.len();
10640 let mut payload_buf = [0; Self::ENCODED_LEN];
10641 let mut buf = if avail_len < Self::ENCODED_LEN {
10642 payload_buf[0..avail_len].copy_from_slice(__input);
10643 Bytes::new(&payload_buf)
10644 } else {
10645 Bytes::new(__input)
10646 };
10647 let mut __struct = Self::default();
10648 __struct.time_boot_ms = buf.get_u32_le();
10649 __struct.min_distance = buf.get_u16_le();
10650 __struct.max_distance = buf.get_u16_le();
10651 __struct.current_distance = buf.get_u16_le();
10652 let tmp = buf.get_u8();
10653 __struct.mavtype =
10654 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
10655 enum_type: "MavDistanceSensor",
10656 value: tmp as u64,
10657 })?;
10658 __struct.id = buf.get_u8();
10659 let tmp = buf.get_u8();
10660 __struct.orientation =
10661 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
10662 enum_type: "MavSensorOrientation",
10663 value: tmp as u64,
10664 })?;
10665 __struct.covariance = buf.get_u8();
10666 __struct.horizontal_fov = buf.get_f32_le();
10667 __struct.vertical_fov = buf.get_f32_le();
10668 for v in &mut __struct.quaternion {
10669 let val = buf.get_f32_le();
10670 *v = val;
10671 }
10672 __struct.signal_quality = buf.get_u8();
10673 Ok(__struct)
10674 }
10675 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
10676 let mut __tmp = BytesMut::new(bytes);
10677 #[allow(clippy::absurd_extreme_comparisons)]
10678 #[allow(unused_comparisons)]
10679 if __tmp.remaining() < Self::ENCODED_LEN {
10680 panic!(
10681 "buffer is too small (need {} bytes, but got {})",
10682 Self::ENCODED_LEN,
10683 __tmp.remaining(),
10684 )
10685 }
10686 __tmp.put_u32_le(self.time_boot_ms);
10687 __tmp.put_u16_le(self.min_distance);
10688 __tmp.put_u16_le(self.max_distance);
10689 __tmp.put_u16_le(self.current_distance);
10690 __tmp.put_u8(self.mavtype as u8);
10691 __tmp.put_u8(self.id);
10692 __tmp.put_u8(self.orientation as u8);
10693 __tmp.put_u8(self.covariance);
10694 if matches!(version, MavlinkVersion::V2) {
10695 __tmp.put_f32_le(self.horizontal_fov);
10696 __tmp.put_f32_le(self.vertical_fov);
10697 for val in &self.quaternion {
10698 __tmp.put_f32_le(*val);
10699 }
10700 __tmp.put_u8(self.signal_quality);
10701 let len = __tmp.len();
10702 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
10703 } else {
10704 __tmp.len()
10705 }
10706 }
10707}
10708#[doc = "EFI status output."]
10709#[doc = ""]
10710#[doc = "ID: 225"]
10711#[derive(Debug, Clone, PartialEq)]
10712#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
10713#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
10714#[cfg_attr(feature = "ts", derive(TS))]
10715#[cfg_attr(feature = "ts", ts(export))]
10716pub struct EFI_STATUS_DATA {
10717 #[doc = "ECU index"]
10718 pub ecu_index: f32,
10719 #[doc = "RPM"]
10720 pub rpm: f32,
10721 #[doc = "Fuel consumed"]
10722 pub fuel_consumed: f32,
10723 #[doc = "Fuel flow rate"]
10724 pub fuel_flow: f32,
10725 #[doc = "Engine load"]
10726 pub engine_load: f32,
10727 #[doc = "Throttle position"]
10728 pub throttle_position: f32,
10729 #[doc = "Spark dwell time"]
10730 pub spark_dwell_time: f32,
10731 #[doc = "Barometric pressure"]
10732 pub barometric_pressure: f32,
10733 #[doc = "Intake manifold pressure("]
10734 pub intake_manifold_pressure: f32,
10735 #[doc = "Intake manifold temperature"]
10736 pub intake_manifold_temperature: f32,
10737 #[doc = "Cylinder head temperature"]
10738 pub cylinder_head_temperature: f32,
10739 #[doc = "Ignition timing (Crank angle degrees)"]
10740 pub ignition_timing: f32,
10741 #[doc = "Injection time"]
10742 pub injection_time: f32,
10743 #[doc = "Exhaust gas temperature"]
10744 pub exhaust_gas_temperature: f32,
10745 #[doc = "Output throttle"]
10746 pub throttle_out: f32,
10747 #[doc = "Pressure/temperature compensation"]
10748 pub pt_compensation: f32,
10749 #[doc = "EFI health status"]
10750 pub health: u8,
10751 #[doc = "Supply voltage to EFI sparking system. Zero in this value means \"unknown\", so if the supply voltage really is zero volts use 0.0001 instead."]
10752 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
10753 pub ignition_voltage: f32,
10754 #[doc = "Fuel pressure. Zero in this value means \"unknown\", so if the fuel pressure really is zero kPa use 0.0001 instead."]
10755 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
10756 pub fuel_pressure: f32,
10757}
10758impl EFI_STATUS_DATA {
10759 pub const ENCODED_LEN: usize = 73usize;
10760 pub const DEFAULT: Self = Self {
10761 ecu_index: 0.0_f32,
10762 rpm: 0.0_f32,
10763 fuel_consumed: 0.0_f32,
10764 fuel_flow: 0.0_f32,
10765 engine_load: 0.0_f32,
10766 throttle_position: 0.0_f32,
10767 spark_dwell_time: 0.0_f32,
10768 barometric_pressure: 0.0_f32,
10769 intake_manifold_pressure: 0.0_f32,
10770 intake_manifold_temperature: 0.0_f32,
10771 cylinder_head_temperature: 0.0_f32,
10772 ignition_timing: 0.0_f32,
10773 injection_time: 0.0_f32,
10774 exhaust_gas_temperature: 0.0_f32,
10775 throttle_out: 0.0_f32,
10776 pt_compensation: 0.0_f32,
10777 health: 0_u8,
10778 ignition_voltage: 0.0_f32,
10779 fuel_pressure: 0.0_f32,
10780 };
10781 #[cfg(feature = "arbitrary")]
10782 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
10783 use arbitrary::{Arbitrary, Unstructured};
10784 let mut buf = [0u8; 1024];
10785 rng.fill_bytes(&mut buf);
10786 let mut unstructured = Unstructured::new(&buf);
10787 Self::arbitrary(&mut unstructured).unwrap_or_default()
10788 }
10789}
10790impl Default for EFI_STATUS_DATA {
10791 fn default() -> Self {
10792 Self::DEFAULT.clone()
10793 }
10794}
10795impl MessageData for EFI_STATUS_DATA {
10796 type Message = MavMessage;
10797 const ID: u32 = 225u32;
10798 const NAME: &'static str = "EFI_STATUS";
10799 const EXTRA_CRC: u8 = 208u8;
10800 const ENCODED_LEN: usize = 73usize;
10801 fn deser(
10802 _version: MavlinkVersion,
10803 __input: &[u8],
10804 ) -> Result<Self, ::mavlink_core::error::ParserError> {
10805 let avail_len = __input.len();
10806 let mut payload_buf = [0; Self::ENCODED_LEN];
10807 let mut buf = if avail_len < Self::ENCODED_LEN {
10808 payload_buf[0..avail_len].copy_from_slice(__input);
10809 Bytes::new(&payload_buf)
10810 } else {
10811 Bytes::new(__input)
10812 };
10813 let mut __struct = Self::default();
10814 __struct.ecu_index = buf.get_f32_le();
10815 __struct.rpm = buf.get_f32_le();
10816 __struct.fuel_consumed = buf.get_f32_le();
10817 __struct.fuel_flow = buf.get_f32_le();
10818 __struct.engine_load = buf.get_f32_le();
10819 __struct.throttle_position = buf.get_f32_le();
10820 __struct.spark_dwell_time = buf.get_f32_le();
10821 __struct.barometric_pressure = buf.get_f32_le();
10822 __struct.intake_manifold_pressure = buf.get_f32_le();
10823 __struct.intake_manifold_temperature = buf.get_f32_le();
10824 __struct.cylinder_head_temperature = buf.get_f32_le();
10825 __struct.ignition_timing = buf.get_f32_le();
10826 __struct.injection_time = buf.get_f32_le();
10827 __struct.exhaust_gas_temperature = buf.get_f32_le();
10828 __struct.throttle_out = buf.get_f32_le();
10829 __struct.pt_compensation = buf.get_f32_le();
10830 __struct.health = buf.get_u8();
10831 __struct.ignition_voltage = buf.get_f32_le();
10832 __struct.fuel_pressure = buf.get_f32_le();
10833 Ok(__struct)
10834 }
10835 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
10836 let mut __tmp = BytesMut::new(bytes);
10837 #[allow(clippy::absurd_extreme_comparisons)]
10838 #[allow(unused_comparisons)]
10839 if __tmp.remaining() < Self::ENCODED_LEN {
10840 panic!(
10841 "buffer is too small (need {} bytes, but got {})",
10842 Self::ENCODED_LEN,
10843 __tmp.remaining(),
10844 )
10845 }
10846 __tmp.put_f32_le(self.ecu_index);
10847 __tmp.put_f32_le(self.rpm);
10848 __tmp.put_f32_le(self.fuel_consumed);
10849 __tmp.put_f32_le(self.fuel_flow);
10850 __tmp.put_f32_le(self.engine_load);
10851 __tmp.put_f32_le(self.throttle_position);
10852 __tmp.put_f32_le(self.spark_dwell_time);
10853 __tmp.put_f32_le(self.barometric_pressure);
10854 __tmp.put_f32_le(self.intake_manifold_pressure);
10855 __tmp.put_f32_le(self.intake_manifold_temperature);
10856 __tmp.put_f32_le(self.cylinder_head_temperature);
10857 __tmp.put_f32_le(self.ignition_timing);
10858 __tmp.put_f32_le(self.injection_time);
10859 __tmp.put_f32_le(self.exhaust_gas_temperature);
10860 __tmp.put_f32_le(self.throttle_out);
10861 __tmp.put_f32_le(self.pt_compensation);
10862 __tmp.put_u8(self.health);
10863 if matches!(version, MavlinkVersion::V2) {
10864 __tmp.put_f32_le(self.ignition_voltage);
10865 __tmp.put_f32_le(self.fuel_pressure);
10866 let len = __tmp.len();
10867 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
10868 } else {
10869 __tmp.len()
10870 }
10871 }
10872}
10873#[doc = "Data packet for images sent using the Image Transmission Protocol: <https://mavlink.io/en/services/image_transmission.html>."]
10874#[doc = ""]
10875#[doc = "ID: 131"]
10876#[derive(Debug, Clone, PartialEq)]
10877#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
10878#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
10879#[cfg_attr(feature = "ts", derive(TS))]
10880#[cfg_attr(feature = "ts", ts(export))]
10881pub struct ENCAPSULATED_DATA_DATA {
10882 #[doc = "sequence number (starting with 0 on every transmission)"]
10883 pub seqnr: u16,
10884 #[doc = "image data bytes"]
10885 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
10886 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
10887 pub data: [u8; 253],
10888}
10889impl ENCAPSULATED_DATA_DATA {
10890 pub const ENCODED_LEN: usize = 255usize;
10891 pub const DEFAULT: Self = Self {
10892 seqnr: 0_u16,
10893 data: [0_u8; 253usize],
10894 };
10895 #[cfg(feature = "arbitrary")]
10896 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
10897 use arbitrary::{Arbitrary, Unstructured};
10898 let mut buf = [0u8; 1024];
10899 rng.fill_bytes(&mut buf);
10900 let mut unstructured = Unstructured::new(&buf);
10901 Self::arbitrary(&mut unstructured).unwrap_or_default()
10902 }
10903}
10904impl Default for ENCAPSULATED_DATA_DATA {
10905 fn default() -> Self {
10906 Self::DEFAULT.clone()
10907 }
10908}
10909impl MessageData for ENCAPSULATED_DATA_DATA {
10910 type Message = MavMessage;
10911 const ID: u32 = 131u32;
10912 const NAME: &'static str = "ENCAPSULATED_DATA";
10913 const EXTRA_CRC: u8 = 223u8;
10914 const ENCODED_LEN: usize = 255usize;
10915 fn deser(
10916 _version: MavlinkVersion,
10917 __input: &[u8],
10918 ) -> Result<Self, ::mavlink_core::error::ParserError> {
10919 let avail_len = __input.len();
10920 let mut payload_buf = [0; Self::ENCODED_LEN];
10921 let mut buf = if avail_len < Self::ENCODED_LEN {
10922 payload_buf[0..avail_len].copy_from_slice(__input);
10923 Bytes::new(&payload_buf)
10924 } else {
10925 Bytes::new(__input)
10926 };
10927 let mut __struct = Self::default();
10928 __struct.seqnr = buf.get_u16_le();
10929 for v in &mut __struct.data {
10930 let val = buf.get_u8();
10931 *v = val;
10932 }
10933 Ok(__struct)
10934 }
10935 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
10936 let mut __tmp = BytesMut::new(bytes);
10937 #[allow(clippy::absurd_extreme_comparisons)]
10938 #[allow(unused_comparisons)]
10939 if __tmp.remaining() < Self::ENCODED_LEN {
10940 panic!(
10941 "buffer is too small (need {} bytes, but got {})",
10942 Self::ENCODED_LEN,
10943 __tmp.remaining(),
10944 )
10945 }
10946 __tmp.put_u16_le(self.seqnr);
10947 for val in &self.data {
10948 __tmp.put_u8(*val);
10949 }
10950 if matches!(version, MavlinkVersion::V2) {
10951 let len = __tmp.len();
10952 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
10953 } else {
10954 __tmp.len()
10955 }
10956 }
10957}
10958#[doc = "ESC information for lower rate streaming. Recommended streaming rate 1Hz. See ESC_STATUS for higher-rate ESC data."]
10959#[doc = ""]
10960#[doc = "ID: 290"]
10961#[derive(Debug, Clone, PartialEq)]
10962#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
10963#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
10964#[cfg_attr(feature = "ts", derive(TS))]
10965#[cfg_attr(feature = "ts", ts(export))]
10966pub struct ESC_INFO_DATA {
10967 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude the number."]
10968 pub time_usec: u64,
10969 #[doc = "Number of reported errors by each ESC since boot."]
10970 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
10971 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
10972 pub error_count: [u32; 4],
10973 #[doc = "Counter of data packets received."]
10974 pub counter: u16,
10975 #[doc = "Bitmap of ESC failure flags."]
10976 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
10977 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
10978 pub failure_flags: [u16; 4],
10979 #[doc = "Temperature of each ESC. INT16_MAX: if data not supplied by ESC."]
10980 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
10981 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
10982 pub temperature: [i16; 4],
10983 #[doc = "Index of the first ESC in this message. minValue = 0, maxValue = 60, increment = 4."]
10984 pub index: u8,
10985 #[doc = "Total number of ESCs in all messages of this type. Message fields with an index higher than this should be ignored because they contain invalid data."]
10986 pub count: u8,
10987 #[doc = "Connection type protocol for all ESC."]
10988 pub connection_type: EscConnectionType,
10989 #[doc = "Information regarding online/offline status of each ESC."]
10990 pub info: u8,
10991}
10992impl ESC_INFO_DATA {
10993 pub const ENCODED_LEN: usize = 46usize;
10994 pub const DEFAULT: Self = Self {
10995 time_usec: 0_u64,
10996 error_count: [0_u32; 4usize],
10997 counter: 0_u16,
10998 failure_flags: [0_u16; 4usize],
10999 temperature: [0_i16; 4usize],
11000 index: 0_u8,
11001 count: 0_u8,
11002 connection_type: EscConnectionType::DEFAULT,
11003 info: 0_u8,
11004 };
11005 #[cfg(feature = "arbitrary")]
11006 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
11007 use arbitrary::{Arbitrary, Unstructured};
11008 let mut buf = [0u8; 1024];
11009 rng.fill_bytes(&mut buf);
11010 let mut unstructured = Unstructured::new(&buf);
11011 Self::arbitrary(&mut unstructured).unwrap_or_default()
11012 }
11013}
11014impl Default for ESC_INFO_DATA {
11015 fn default() -> Self {
11016 Self::DEFAULT.clone()
11017 }
11018}
11019impl MessageData for ESC_INFO_DATA {
11020 type Message = MavMessage;
11021 const ID: u32 = 290u32;
11022 const NAME: &'static str = "ESC_INFO";
11023 const EXTRA_CRC: u8 = 251u8;
11024 const ENCODED_LEN: usize = 46usize;
11025 fn deser(
11026 _version: MavlinkVersion,
11027 __input: &[u8],
11028 ) -> Result<Self, ::mavlink_core::error::ParserError> {
11029 let avail_len = __input.len();
11030 let mut payload_buf = [0; Self::ENCODED_LEN];
11031 let mut buf = if avail_len < Self::ENCODED_LEN {
11032 payload_buf[0..avail_len].copy_from_slice(__input);
11033 Bytes::new(&payload_buf)
11034 } else {
11035 Bytes::new(__input)
11036 };
11037 let mut __struct = Self::default();
11038 __struct.time_usec = buf.get_u64_le();
11039 for v in &mut __struct.error_count {
11040 let val = buf.get_u32_le();
11041 *v = val;
11042 }
11043 __struct.counter = buf.get_u16_le();
11044 for v in &mut __struct.failure_flags {
11045 let val = buf.get_u16_le();
11046 *v = val;
11047 }
11048 for v in &mut __struct.temperature {
11049 let val = buf.get_i16_le();
11050 *v = val;
11051 }
11052 __struct.index = buf.get_u8();
11053 __struct.count = buf.get_u8();
11054 let tmp = buf.get_u8();
11055 __struct.connection_type =
11056 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
11057 enum_type: "EscConnectionType",
11058 value: tmp as u64,
11059 })?;
11060 __struct.info = buf.get_u8();
11061 Ok(__struct)
11062 }
11063 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
11064 let mut __tmp = BytesMut::new(bytes);
11065 #[allow(clippy::absurd_extreme_comparisons)]
11066 #[allow(unused_comparisons)]
11067 if __tmp.remaining() < Self::ENCODED_LEN {
11068 panic!(
11069 "buffer is too small (need {} bytes, but got {})",
11070 Self::ENCODED_LEN,
11071 __tmp.remaining(),
11072 )
11073 }
11074 __tmp.put_u64_le(self.time_usec);
11075 for val in &self.error_count {
11076 __tmp.put_u32_le(*val);
11077 }
11078 __tmp.put_u16_le(self.counter);
11079 for val in &self.failure_flags {
11080 __tmp.put_u16_le(*val);
11081 }
11082 for val in &self.temperature {
11083 __tmp.put_i16_le(*val);
11084 }
11085 __tmp.put_u8(self.index);
11086 __tmp.put_u8(self.count);
11087 __tmp.put_u8(self.connection_type as u8);
11088 __tmp.put_u8(self.info);
11089 if matches!(version, MavlinkVersion::V2) {
11090 let len = __tmp.len();
11091 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
11092 } else {
11093 __tmp.len()
11094 }
11095 }
11096}
11097#[doc = "ESC information for higher rate streaming. Recommended streaming rate is ~10 Hz. Information that changes more slowly is sent in ESC_INFO. It should typically only be streamed on high-bandwidth links (i.e. to a companion computer)."]
11098#[doc = ""]
11099#[doc = "ID: 291"]
11100#[derive(Debug, Clone, PartialEq)]
11101#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
11102#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
11103#[cfg_attr(feature = "ts", derive(TS))]
11104#[cfg_attr(feature = "ts", ts(export))]
11105pub struct ESC_STATUS_DATA {
11106 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude the number."]
11107 pub time_usec: u64,
11108 #[doc = "Reported motor RPM from each ESC (negative for reverse rotation)."]
11109 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
11110 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
11111 pub rpm: [i32; 4],
11112 #[doc = "Voltage measured from each ESC."]
11113 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
11114 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
11115 pub voltage: [f32; 4],
11116 #[doc = "Current measured from each ESC."]
11117 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
11118 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
11119 pub current: [f32; 4],
11120 #[doc = "Index of the first ESC in this message. minValue = 0, maxValue = 60, increment = 4."]
11121 pub index: u8,
11122}
11123impl ESC_STATUS_DATA {
11124 pub const ENCODED_LEN: usize = 57usize;
11125 pub const DEFAULT: Self = Self {
11126 time_usec: 0_u64,
11127 rpm: [0_i32; 4usize],
11128 voltage: [0.0_f32; 4usize],
11129 current: [0.0_f32; 4usize],
11130 index: 0_u8,
11131 };
11132 #[cfg(feature = "arbitrary")]
11133 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
11134 use arbitrary::{Arbitrary, Unstructured};
11135 let mut buf = [0u8; 1024];
11136 rng.fill_bytes(&mut buf);
11137 let mut unstructured = Unstructured::new(&buf);
11138 Self::arbitrary(&mut unstructured).unwrap_or_default()
11139 }
11140}
11141impl Default for ESC_STATUS_DATA {
11142 fn default() -> Self {
11143 Self::DEFAULT.clone()
11144 }
11145}
11146impl MessageData for ESC_STATUS_DATA {
11147 type Message = MavMessage;
11148 const ID: u32 = 291u32;
11149 const NAME: &'static str = "ESC_STATUS";
11150 const EXTRA_CRC: u8 = 10u8;
11151 const ENCODED_LEN: usize = 57usize;
11152 fn deser(
11153 _version: MavlinkVersion,
11154 __input: &[u8],
11155 ) -> Result<Self, ::mavlink_core::error::ParserError> {
11156 let avail_len = __input.len();
11157 let mut payload_buf = [0; Self::ENCODED_LEN];
11158 let mut buf = if avail_len < Self::ENCODED_LEN {
11159 payload_buf[0..avail_len].copy_from_slice(__input);
11160 Bytes::new(&payload_buf)
11161 } else {
11162 Bytes::new(__input)
11163 };
11164 let mut __struct = Self::default();
11165 __struct.time_usec = buf.get_u64_le();
11166 for v in &mut __struct.rpm {
11167 let val = buf.get_i32_le();
11168 *v = val;
11169 }
11170 for v in &mut __struct.voltage {
11171 let val = buf.get_f32_le();
11172 *v = val;
11173 }
11174 for v in &mut __struct.current {
11175 let val = buf.get_f32_le();
11176 *v = val;
11177 }
11178 __struct.index = buf.get_u8();
11179 Ok(__struct)
11180 }
11181 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
11182 let mut __tmp = BytesMut::new(bytes);
11183 #[allow(clippy::absurd_extreme_comparisons)]
11184 #[allow(unused_comparisons)]
11185 if __tmp.remaining() < Self::ENCODED_LEN {
11186 panic!(
11187 "buffer is too small (need {} bytes, but got {})",
11188 Self::ENCODED_LEN,
11189 __tmp.remaining(),
11190 )
11191 }
11192 __tmp.put_u64_le(self.time_usec);
11193 for val in &self.rpm {
11194 __tmp.put_i32_le(*val);
11195 }
11196 for val in &self.voltage {
11197 __tmp.put_f32_le(*val);
11198 }
11199 for val in &self.current {
11200 __tmp.put_f32_le(*val);
11201 }
11202 __tmp.put_u8(self.index);
11203 if matches!(version, MavlinkVersion::V2) {
11204 let len = __tmp.len();
11205 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
11206 } else {
11207 __tmp.len()
11208 }
11209 }
11210}
11211#[doc = "Estimator status message including flags, innovation test ratios and estimated accuracies. The flags message is an integer bitmask containing information on which EKF outputs are valid. See the ESTIMATOR_STATUS_FLAGS enum definition for further information. The innovation test ratios show the magnitude of the sensor innovation divided by the innovation check threshold. Under normal operation the innovation test ratios should be below 0.5 with occasional values up to 1.0. Values greater than 1.0 should be rare under normal operation and indicate that a measurement has been rejected by the filter. The user should be notified if an innovation test ratio greater than 1.0 is recorded. Notifications for values in the range between 0.5 and 1.0 should be optional and controllable by the user."]
11212#[doc = ""]
11213#[doc = "ID: 230"]
11214#[derive(Debug, Clone, PartialEq)]
11215#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
11216#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
11217#[cfg_attr(feature = "ts", derive(TS))]
11218#[cfg_attr(feature = "ts", ts(export))]
11219pub struct ESTIMATOR_STATUS_DATA {
11220 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
11221 pub time_usec: u64,
11222 #[doc = "Velocity innovation test ratio"]
11223 pub vel_ratio: f32,
11224 #[doc = "Horizontal position innovation test ratio"]
11225 pub pos_horiz_ratio: f32,
11226 #[doc = "Vertical position innovation test ratio"]
11227 pub pos_vert_ratio: f32,
11228 #[doc = "Magnetometer innovation test ratio"]
11229 pub mag_ratio: f32,
11230 #[doc = "Height above terrain innovation test ratio"]
11231 pub hagl_ratio: f32,
11232 #[doc = "True airspeed innovation test ratio"]
11233 pub tas_ratio: f32,
11234 #[doc = "Horizontal position 1-STD accuracy relative to the EKF local origin"]
11235 pub pos_horiz_accuracy: f32,
11236 #[doc = "Vertical position 1-STD accuracy relative to the EKF local origin"]
11237 pub pos_vert_accuracy: f32,
11238 #[doc = "Bitmap indicating which EKF outputs are valid."]
11239 pub flags: EstimatorStatusFlags,
11240}
11241impl ESTIMATOR_STATUS_DATA {
11242 pub const ENCODED_LEN: usize = 42usize;
11243 pub const DEFAULT: Self = Self {
11244 time_usec: 0_u64,
11245 vel_ratio: 0.0_f32,
11246 pos_horiz_ratio: 0.0_f32,
11247 pos_vert_ratio: 0.0_f32,
11248 mag_ratio: 0.0_f32,
11249 hagl_ratio: 0.0_f32,
11250 tas_ratio: 0.0_f32,
11251 pos_horiz_accuracy: 0.0_f32,
11252 pos_vert_accuracy: 0.0_f32,
11253 flags: EstimatorStatusFlags::DEFAULT,
11254 };
11255 #[cfg(feature = "arbitrary")]
11256 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
11257 use arbitrary::{Arbitrary, Unstructured};
11258 let mut buf = [0u8; 1024];
11259 rng.fill_bytes(&mut buf);
11260 let mut unstructured = Unstructured::new(&buf);
11261 Self::arbitrary(&mut unstructured).unwrap_or_default()
11262 }
11263}
11264impl Default for ESTIMATOR_STATUS_DATA {
11265 fn default() -> Self {
11266 Self::DEFAULT.clone()
11267 }
11268}
11269impl MessageData for ESTIMATOR_STATUS_DATA {
11270 type Message = MavMessage;
11271 const ID: u32 = 230u32;
11272 const NAME: &'static str = "ESTIMATOR_STATUS";
11273 const EXTRA_CRC: u8 = 163u8;
11274 const ENCODED_LEN: usize = 42usize;
11275 fn deser(
11276 _version: MavlinkVersion,
11277 __input: &[u8],
11278 ) -> Result<Self, ::mavlink_core::error::ParserError> {
11279 let avail_len = __input.len();
11280 let mut payload_buf = [0; Self::ENCODED_LEN];
11281 let mut buf = if avail_len < Self::ENCODED_LEN {
11282 payload_buf[0..avail_len].copy_from_slice(__input);
11283 Bytes::new(&payload_buf)
11284 } else {
11285 Bytes::new(__input)
11286 };
11287 let mut __struct = Self::default();
11288 __struct.time_usec = buf.get_u64_le();
11289 __struct.vel_ratio = buf.get_f32_le();
11290 __struct.pos_horiz_ratio = buf.get_f32_le();
11291 __struct.pos_vert_ratio = buf.get_f32_le();
11292 __struct.mag_ratio = buf.get_f32_le();
11293 __struct.hagl_ratio = buf.get_f32_le();
11294 __struct.tas_ratio = buf.get_f32_le();
11295 __struct.pos_horiz_accuracy = buf.get_f32_le();
11296 __struct.pos_vert_accuracy = buf.get_f32_le();
11297 let tmp = buf.get_u16_le();
11298 __struct.flags = EstimatorStatusFlags::from_bits(
11299 tmp as <EstimatorStatusFlags as Flags>::Bits,
11300 )
11301 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
11302 flag_type: "EstimatorStatusFlags",
11303 value: tmp as u64,
11304 })?;
11305 Ok(__struct)
11306 }
11307 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
11308 let mut __tmp = BytesMut::new(bytes);
11309 #[allow(clippy::absurd_extreme_comparisons)]
11310 #[allow(unused_comparisons)]
11311 if __tmp.remaining() < Self::ENCODED_LEN {
11312 panic!(
11313 "buffer is too small (need {} bytes, but got {})",
11314 Self::ENCODED_LEN,
11315 __tmp.remaining(),
11316 )
11317 }
11318 __tmp.put_u64_le(self.time_usec);
11319 __tmp.put_f32_le(self.vel_ratio);
11320 __tmp.put_f32_le(self.pos_horiz_ratio);
11321 __tmp.put_f32_le(self.pos_vert_ratio);
11322 __tmp.put_f32_le(self.mag_ratio);
11323 __tmp.put_f32_le(self.hagl_ratio);
11324 __tmp.put_f32_le(self.tas_ratio);
11325 __tmp.put_f32_le(self.pos_horiz_accuracy);
11326 __tmp.put_f32_le(self.pos_vert_accuracy);
11327 __tmp.put_u16_le(self.flags.bits() as u16);
11328 if matches!(version, MavlinkVersion::V2) {
11329 let len = __tmp.len();
11330 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
11331 } else {
11332 __tmp.len()
11333 }
11334 }
11335}
11336#[doc = "Event message. Each new event from a particular component gets a new sequence number. The same message might be sent multiple times if (re-)requested. Most events are broadcast, some can be specific to a target component (as receivers keep track of the sequence for missed events, all events need to be broadcast. Thus we use destination_component instead of target_component)."]
11337#[doc = ""]
11338#[doc = "ID: 410"]
11339#[derive(Debug, Clone, PartialEq)]
11340#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
11341#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
11342#[cfg_attr(feature = "ts", derive(TS))]
11343#[cfg_attr(feature = "ts", ts(export))]
11344pub struct EVENT_DATA {
11345 #[doc = "Event ID (as defined in the component metadata)"]
11346 pub id: u32,
11347 #[doc = "Timestamp (time since system boot when the event happened)."]
11348 pub event_time_boot_ms: u32,
11349 #[doc = "Sequence number."]
11350 pub sequence: u16,
11351 #[doc = "Component ID"]
11352 pub destination_component: u8,
11353 #[doc = "System ID"]
11354 pub destination_system: u8,
11355 #[doc = "Log levels: 4 bits MSB: internal (for logging purposes), 4 bits LSB: external. Levels: Emergency = 0, Alert = 1, Critical = 2, Error = 3, Warning = 4, Notice = 5, Info = 6, Debug = 7, Protocol = 8, Disabled = 9"]
11356 pub log_levels: u8,
11357 #[doc = "Arguments (depend on event ID)."]
11358 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
11359 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
11360 pub arguments: [u8; 40],
11361}
11362impl EVENT_DATA {
11363 pub const ENCODED_LEN: usize = 53usize;
11364 pub const DEFAULT: Self = Self {
11365 id: 0_u32,
11366 event_time_boot_ms: 0_u32,
11367 sequence: 0_u16,
11368 destination_component: 0_u8,
11369 destination_system: 0_u8,
11370 log_levels: 0_u8,
11371 arguments: [0_u8; 40usize],
11372 };
11373 #[cfg(feature = "arbitrary")]
11374 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
11375 use arbitrary::{Arbitrary, Unstructured};
11376 let mut buf = [0u8; 1024];
11377 rng.fill_bytes(&mut buf);
11378 let mut unstructured = Unstructured::new(&buf);
11379 Self::arbitrary(&mut unstructured).unwrap_or_default()
11380 }
11381}
11382impl Default for EVENT_DATA {
11383 fn default() -> Self {
11384 Self::DEFAULT.clone()
11385 }
11386}
11387impl MessageData for EVENT_DATA {
11388 type Message = MavMessage;
11389 const ID: u32 = 410u32;
11390 const NAME: &'static str = "EVENT";
11391 const EXTRA_CRC: u8 = 160u8;
11392 const ENCODED_LEN: usize = 53usize;
11393 fn deser(
11394 _version: MavlinkVersion,
11395 __input: &[u8],
11396 ) -> Result<Self, ::mavlink_core::error::ParserError> {
11397 let avail_len = __input.len();
11398 let mut payload_buf = [0; Self::ENCODED_LEN];
11399 let mut buf = if avail_len < Self::ENCODED_LEN {
11400 payload_buf[0..avail_len].copy_from_slice(__input);
11401 Bytes::new(&payload_buf)
11402 } else {
11403 Bytes::new(__input)
11404 };
11405 let mut __struct = Self::default();
11406 __struct.id = buf.get_u32_le();
11407 __struct.event_time_boot_ms = buf.get_u32_le();
11408 __struct.sequence = buf.get_u16_le();
11409 __struct.destination_component = buf.get_u8();
11410 __struct.destination_system = buf.get_u8();
11411 __struct.log_levels = buf.get_u8();
11412 for v in &mut __struct.arguments {
11413 let val = buf.get_u8();
11414 *v = val;
11415 }
11416 Ok(__struct)
11417 }
11418 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
11419 let mut __tmp = BytesMut::new(bytes);
11420 #[allow(clippy::absurd_extreme_comparisons)]
11421 #[allow(unused_comparisons)]
11422 if __tmp.remaining() < Self::ENCODED_LEN {
11423 panic!(
11424 "buffer is too small (need {} bytes, but got {})",
11425 Self::ENCODED_LEN,
11426 __tmp.remaining(),
11427 )
11428 }
11429 __tmp.put_u32_le(self.id);
11430 __tmp.put_u32_le(self.event_time_boot_ms);
11431 __tmp.put_u16_le(self.sequence);
11432 __tmp.put_u8(self.destination_component);
11433 __tmp.put_u8(self.destination_system);
11434 __tmp.put_u8(self.log_levels);
11435 for val in &self.arguments {
11436 __tmp.put_u8(*val);
11437 }
11438 if matches!(version, MavlinkVersion::V2) {
11439 let len = __tmp.len();
11440 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
11441 } else {
11442 __tmp.len()
11443 }
11444 }
11445}
11446#[doc = "Provides state for additional features."]
11447#[doc = ""]
11448#[doc = "ID: 245"]
11449#[derive(Debug, Clone, PartialEq)]
11450#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
11451#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
11452#[cfg_attr(feature = "ts", derive(TS))]
11453#[cfg_attr(feature = "ts", ts(export))]
11454pub struct EXTENDED_SYS_STATE_DATA {
11455 #[doc = "The VTOL state if applicable. Is set to MAV_VTOL_STATE_UNDEFINED if UAV is not in VTOL configuration."]
11456 pub vtol_state: MavVtolState,
11457 #[doc = "The landed state. Is set to MAV_LANDED_STATE_UNDEFINED if landed state is unknown."]
11458 pub landed_state: MavLandedState,
11459}
11460impl EXTENDED_SYS_STATE_DATA {
11461 pub const ENCODED_LEN: usize = 2usize;
11462 pub const DEFAULT: Self = Self {
11463 vtol_state: MavVtolState::DEFAULT,
11464 landed_state: MavLandedState::DEFAULT,
11465 };
11466 #[cfg(feature = "arbitrary")]
11467 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
11468 use arbitrary::{Arbitrary, Unstructured};
11469 let mut buf = [0u8; 1024];
11470 rng.fill_bytes(&mut buf);
11471 let mut unstructured = Unstructured::new(&buf);
11472 Self::arbitrary(&mut unstructured).unwrap_or_default()
11473 }
11474}
11475impl Default for EXTENDED_SYS_STATE_DATA {
11476 fn default() -> Self {
11477 Self::DEFAULT.clone()
11478 }
11479}
11480impl MessageData for EXTENDED_SYS_STATE_DATA {
11481 type Message = MavMessage;
11482 const ID: u32 = 245u32;
11483 const NAME: &'static str = "EXTENDED_SYS_STATE";
11484 const EXTRA_CRC: u8 = 130u8;
11485 const ENCODED_LEN: usize = 2usize;
11486 fn deser(
11487 _version: MavlinkVersion,
11488 __input: &[u8],
11489 ) -> Result<Self, ::mavlink_core::error::ParserError> {
11490 let avail_len = __input.len();
11491 let mut payload_buf = [0; Self::ENCODED_LEN];
11492 let mut buf = if avail_len < Self::ENCODED_LEN {
11493 payload_buf[0..avail_len].copy_from_slice(__input);
11494 Bytes::new(&payload_buf)
11495 } else {
11496 Bytes::new(__input)
11497 };
11498 let mut __struct = Self::default();
11499 let tmp = buf.get_u8();
11500 __struct.vtol_state =
11501 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
11502 enum_type: "MavVtolState",
11503 value: tmp as u64,
11504 })?;
11505 let tmp = buf.get_u8();
11506 __struct.landed_state =
11507 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
11508 enum_type: "MavLandedState",
11509 value: tmp as u64,
11510 })?;
11511 Ok(__struct)
11512 }
11513 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
11514 let mut __tmp = BytesMut::new(bytes);
11515 #[allow(clippy::absurd_extreme_comparisons)]
11516 #[allow(unused_comparisons)]
11517 if __tmp.remaining() < Self::ENCODED_LEN {
11518 panic!(
11519 "buffer is too small (need {} bytes, but got {})",
11520 Self::ENCODED_LEN,
11521 __tmp.remaining(),
11522 )
11523 }
11524 __tmp.put_u8(self.vtol_state as u8);
11525 __tmp.put_u8(self.landed_state as u8);
11526 if matches!(version, MavlinkVersion::V2) {
11527 let len = __tmp.len();
11528 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
11529 } else {
11530 __tmp.len()
11531 }
11532 }
11533}
11534#[doc = "Status of geo-fencing. Sent in extended status stream when fencing enabled."]
11535#[doc = ""]
11536#[doc = "ID: 162"]
11537#[derive(Debug, Clone, PartialEq)]
11538#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
11539#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
11540#[cfg_attr(feature = "ts", derive(TS))]
11541#[cfg_attr(feature = "ts", ts(export))]
11542pub struct FENCE_STATUS_DATA {
11543 #[doc = "Time (since boot) of last breach."]
11544 pub breach_time: u32,
11545 #[doc = "Number of fence breaches."]
11546 pub breach_count: u16,
11547 #[doc = "Breach status (0 if currently inside fence, 1 if outside)."]
11548 pub breach_status: u8,
11549 #[doc = "Last breach type."]
11550 pub breach_type: FenceBreach,
11551 #[doc = "Active action to prevent fence breach"]
11552 #[cfg_attr(feature = "serde", serde(default))]
11553 pub breach_mitigation: FenceMitigate,
11554}
11555impl FENCE_STATUS_DATA {
11556 pub const ENCODED_LEN: usize = 9usize;
11557 pub const DEFAULT: Self = Self {
11558 breach_time: 0_u32,
11559 breach_count: 0_u16,
11560 breach_status: 0_u8,
11561 breach_type: FenceBreach::DEFAULT,
11562 breach_mitigation: FenceMitigate::DEFAULT,
11563 };
11564 #[cfg(feature = "arbitrary")]
11565 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
11566 use arbitrary::{Arbitrary, Unstructured};
11567 let mut buf = [0u8; 1024];
11568 rng.fill_bytes(&mut buf);
11569 let mut unstructured = Unstructured::new(&buf);
11570 Self::arbitrary(&mut unstructured).unwrap_or_default()
11571 }
11572}
11573impl Default for FENCE_STATUS_DATA {
11574 fn default() -> Self {
11575 Self::DEFAULT.clone()
11576 }
11577}
11578impl MessageData for FENCE_STATUS_DATA {
11579 type Message = MavMessage;
11580 const ID: u32 = 162u32;
11581 const NAME: &'static str = "FENCE_STATUS";
11582 const EXTRA_CRC: u8 = 189u8;
11583 const ENCODED_LEN: usize = 9usize;
11584 fn deser(
11585 _version: MavlinkVersion,
11586 __input: &[u8],
11587 ) -> Result<Self, ::mavlink_core::error::ParserError> {
11588 let avail_len = __input.len();
11589 let mut payload_buf = [0; Self::ENCODED_LEN];
11590 let mut buf = if avail_len < Self::ENCODED_LEN {
11591 payload_buf[0..avail_len].copy_from_slice(__input);
11592 Bytes::new(&payload_buf)
11593 } else {
11594 Bytes::new(__input)
11595 };
11596 let mut __struct = Self::default();
11597 __struct.breach_time = buf.get_u32_le();
11598 __struct.breach_count = buf.get_u16_le();
11599 __struct.breach_status = buf.get_u8();
11600 let tmp = buf.get_u8();
11601 __struct.breach_type =
11602 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
11603 enum_type: "FenceBreach",
11604 value: tmp as u64,
11605 })?;
11606 let tmp = buf.get_u8();
11607 __struct.breach_mitigation =
11608 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
11609 enum_type: "FenceMitigate",
11610 value: tmp as u64,
11611 })?;
11612 Ok(__struct)
11613 }
11614 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
11615 let mut __tmp = BytesMut::new(bytes);
11616 #[allow(clippy::absurd_extreme_comparisons)]
11617 #[allow(unused_comparisons)]
11618 if __tmp.remaining() < Self::ENCODED_LEN {
11619 panic!(
11620 "buffer is too small (need {} bytes, but got {})",
11621 Self::ENCODED_LEN,
11622 __tmp.remaining(),
11623 )
11624 }
11625 __tmp.put_u32_le(self.breach_time);
11626 __tmp.put_u16_le(self.breach_count);
11627 __tmp.put_u8(self.breach_status);
11628 __tmp.put_u8(self.breach_type as u8);
11629 if matches!(version, MavlinkVersion::V2) {
11630 __tmp.put_u8(self.breach_mitigation as u8);
11631 let len = __tmp.len();
11632 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
11633 } else {
11634 __tmp.len()
11635 }
11636 }
11637}
11638#[doc = "File transfer protocol message: <https://mavlink.io/en/services/ftp.html>."]
11639#[doc = ""]
11640#[doc = "ID: 110"]
11641#[derive(Debug, Clone, PartialEq)]
11642#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
11643#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
11644#[cfg_attr(feature = "ts", derive(TS))]
11645#[cfg_attr(feature = "ts", ts(export))]
11646pub struct FILE_TRANSFER_PROTOCOL_DATA {
11647 #[doc = "Network ID (0 for broadcast)"]
11648 pub target_network: u8,
11649 #[doc = "System ID (0 for broadcast)"]
11650 pub target_system: u8,
11651 #[doc = "Component ID (0 for broadcast)"]
11652 pub target_component: u8,
11653 #[doc = "Variable length payload. The length is defined by the remaining message length when subtracting the header and other fields. The content/format of this block is defined in <https://mavlink.io/en/services/ftp.html>."]
11654 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
11655 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
11656 pub payload: [u8; 251],
11657}
11658impl FILE_TRANSFER_PROTOCOL_DATA {
11659 pub const ENCODED_LEN: usize = 254usize;
11660 pub const DEFAULT: Self = Self {
11661 target_network: 0_u8,
11662 target_system: 0_u8,
11663 target_component: 0_u8,
11664 payload: [0_u8; 251usize],
11665 };
11666 #[cfg(feature = "arbitrary")]
11667 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
11668 use arbitrary::{Arbitrary, Unstructured};
11669 let mut buf = [0u8; 1024];
11670 rng.fill_bytes(&mut buf);
11671 let mut unstructured = Unstructured::new(&buf);
11672 Self::arbitrary(&mut unstructured).unwrap_or_default()
11673 }
11674}
11675impl Default for FILE_TRANSFER_PROTOCOL_DATA {
11676 fn default() -> Self {
11677 Self::DEFAULT.clone()
11678 }
11679}
11680impl MessageData for FILE_TRANSFER_PROTOCOL_DATA {
11681 type Message = MavMessage;
11682 const ID: u32 = 110u32;
11683 const NAME: &'static str = "FILE_TRANSFER_PROTOCOL";
11684 const EXTRA_CRC: u8 = 84u8;
11685 const ENCODED_LEN: usize = 254usize;
11686 fn deser(
11687 _version: MavlinkVersion,
11688 __input: &[u8],
11689 ) -> Result<Self, ::mavlink_core::error::ParserError> {
11690 let avail_len = __input.len();
11691 let mut payload_buf = [0; Self::ENCODED_LEN];
11692 let mut buf = if avail_len < Self::ENCODED_LEN {
11693 payload_buf[0..avail_len].copy_from_slice(__input);
11694 Bytes::new(&payload_buf)
11695 } else {
11696 Bytes::new(__input)
11697 };
11698 let mut __struct = Self::default();
11699 __struct.target_network = buf.get_u8();
11700 __struct.target_system = buf.get_u8();
11701 __struct.target_component = buf.get_u8();
11702 for v in &mut __struct.payload {
11703 let val = buf.get_u8();
11704 *v = val;
11705 }
11706 Ok(__struct)
11707 }
11708 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
11709 let mut __tmp = BytesMut::new(bytes);
11710 #[allow(clippy::absurd_extreme_comparisons)]
11711 #[allow(unused_comparisons)]
11712 if __tmp.remaining() < Self::ENCODED_LEN {
11713 panic!(
11714 "buffer is too small (need {} bytes, but got {})",
11715 Self::ENCODED_LEN,
11716 __tmp.remaining(),
11717 )
11718 }
11719 __tmp.put_u8(self.target_network);
11720 __tmp.put_u8(self.target_system);
11721 __tmp.put_u8(self.target_component);
11722 for val in &self.payload {
11723 __tmp.put_u8(*val);
11724 }
11725 if matches!(version, MavlinkVersion::V2) {
11726 let len = __tmp.len();
11727 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
11728 } else {
11729 __tmp.len()
11730 }
11731 }
11732}
11733#[doc = "Flight information. This includes time since boot for arm, takeoff, and land, and a flight number. Takeoff and landing values reset to zero on arm. This can be requested using MAV_CMD_REQUEST_MESSAGE. Note, some fields are misnamed - timestamps are from boot (not UTC) and the flight_uuid is a sequence number."]
11734#[doc = ""]
11735#[doc = "ID: 264"]
11736#[derive(Debug, Clone, PartialEq)]
11737#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
11738#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
11739#[cfg_attr(feature = "ts", derive(TS))]
11740#[cfg_attr(feature = "ts", ts(export))]
11741pub struct FLIGHT_INFORMATION_DATA {
11742 #[doc = "Timestamp at arming (since system boot). Set to 0 on boot. Set value on arming. Note, field is misnamed UTC."]
11743 pub arming_time_utc: u64,
11744 #[doc = "Timestamp at takeoff (since system boot). Set to 0 at boot and on arming. Note, field is misnamed UTC."]
11745 pub takeoff_time_utc: u64,
11746 #[doc = "Flight number. Note, field is misnamed UUID."]
11747 pub flight_uuid: u64,
11748 #[doc = "Timestamp (time since system boot)."]
11749 pub time_boot_ms: u32,
11750 #[doc = "Timestamp at landing (in ms since system boot). Set to 0 at boot and on arming."]
11751 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
11752 pub landing_time: u32,
11753}
11754impl FLIGHT_INFORMATION_DATA {
11755 pub const ENCODED_LEN: usize = 32usize;
11756 pub const DEFAULT: Self = Self {
11757 arming_time_utc: 0_u64,
11758 takeoff_time_utc: 0_u64,
11759 flight_uuid: 0_u64,
11760 time_boot_ms: 0_u32,
11761 landing_time: 0_u32,
11762 };
11763 #[cfg(feature = "arbitrary")]
11764 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
11765 use arbitrary::{Arbitrary, Unstructured};
11766 let mut buf = [0u8; 1024];
11767 rng.fill_bytes(&mut buf);
11768 let mut unstructured = Unstructured::new(&buf);
11769 Self::arbitrary(&mut unstructured).unwrap_or_default()
11770 }
11771}
11772impl Default for FLIGHT_INFORMATION_DATA {
11773 fn default() -> Self {
11774 Self::DEFAULT.clone()
11775 }
11776}
11777impl MessageData for FLIGHT_INFORMATION_DATA {
11778 type Message = MavMessage;
11779 const ID: u32 = 264u32;
11780 const NAME: &'static str = "FLIGHT_INFORMATION";
11781 const EXTRA_CRC: u8 = 49u8;
11782 const ENCODED_LEN: usize = 32usize;
11783 fn deser(
11784 _version: MavlinkVersion,
11785 __input: &[u8],
11786 ) -> Result<Self, ::mavlink_core::error::ParserError> {
11787 let avail_len = __input.len();
11788 let mut payload_buf = [0; Self::ENCODED_LEN];
11789 let mut buf = if avail_len < Self::ENCODED_LEN {
11790 payload_buf[0..avail_len].copy_from_slice(__input);
11791 Bytes::new(&payload_buf)
11792 } else {
11793 Bytes::new(__input)
11794 };
11795 let mut __struct = Self::default();
11796 __struct.arming_time_utc = buf.get_u64_le();
11797 __struct.takeoff_time_utc = buf.get_u64_le();
11798 __struct.flight_uuid = buf.get_u64_le();
11799 __struct.time_boot_ms = buf.get_u32_le();
11800 __struct.landing_time = buf.get_u32_le();
11801 Ok(__struct)
11802 }
11803 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
11804 let mut __tmp = BytesMut::new(bytes);
11805 #[allow(clippy::absurd_extreme_comparisons)]
11806 #[allow(unused_comparisons)]
11807 if __tmp.remaining() < Self::ENCODED_LEN {
11808 panic!(
11809 "buffer is too small (need {} bytes, but got {})",
11810 Self::ENCODED_LEN,
11811 __tmp.remaining(),
11812 )
11813 }
11814 __tmp.put_u64_le(self.arming_time_utc);
11815 __tmp.put_u64_le(self.takeoff_time_utc);
11816 __tmp.put_u64_le(self.flight_uuid);
11817 __tmp.put_u32_le(self.time_boot_ms);
11818 if matches!(version, MavlinkVersion::V2) {
11819 __tmp.put_u32_le(self.landing_time);
11820 let len = __tmp.len();
11821 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
11822 } else {
11823 __tmp.len()
11824 }
11825 }
11826}
11827#[doc = "Current motion information from a designated system."]
11828#[doc = ""]
11829#[doc = "ID: 144"]
11830#[derive(Debug, Clone, PartialEq)]
11831#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
11832#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
11833#[cfg_attr(feature = "ts", derive(TS))]
11834#[cfg_attr(feature = "ts", ts(export))]
11835pub struct FOLLOW_TARGET_DATA {
11836 #[doc = "Timestamp (time since system boot)."]
11837 pub timestamp: u64,
11838 #[doc = "button states or switches of a tracker device"]
11839 pub custom_state: u64,
11840 #[doc = "Latitude (WGS84)"]
11841 pub lat: i32,
11842 #[doc = "Longitude (WGS84)"]
11843 pub lon: i32,
11844 #[doc = "Altitude (MSL)"]
11845 pub alt: f32,
11846 #[doc = "target velocity (0,0,0) for unknown"]
11847 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
11848 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
11849 pub vel: [f32; 3],
11850 #[doc = "linear target acceleration (0,0,0) for unknown"]
11851 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
11852 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
11853 pub acc: [f32; 3],
11854 #[doc = "(0 0 0 0 for unknown)"]
11855 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
11856 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
11857 pub attitude_q: [f32; 4],
11858 #[doc = "(0 0 0 for unknown)"]
11859 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
11860 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
11861 pub rates: [f32; 3],
11862 #[doc = "eph epv"]
11863 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
11864 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
11865 pub position_cov: [f32; 3],
11866 #[doc = "bit positions for tracker reporting capabilities (POS = 0, VEL = 1, ACCEL = 2, ATT + RATES = 3)"]
11867 pub est_capabilities: u8,
11868}
11869impl FOLLOW_TARGET_DATA {
11870 pub const ENCODED_LEN: usize = 93usize;
11871 pub const DEFAULT: Self = Self {
11872 timestamp: 0_u64,
11873 custom_state: 0_u64,
11874 lat: 0_i32,
11875 lon: 0_i32,
11876 alt: 0.0_f32,
11877 vel: [0.0_f32; 3usize],
11878 acc: [0.0_f32; 3usize],
11879 attitude_q: [0.0_f32; 4usize],
11880 rates: [0.0_f32; 3usize],
11881 position_cov: [0.0_f32; 3usize],
11882 est_capabilities: 0_u8,
11883 };
11884 #[cfg(feature = "arbitrary")]
11885 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
11886 use arbitrary::{Arbitrary, Unstructured};
11887 let mut buf = [0u8; 1024];
11888 rng.fill_bytes(&mut buf);
11889 let mut unstructured = Unstructured::new(&buf);
11890 Self::arbitrary(&mut unstructured).unwrap_or_default()
11891 }
11892}
11893impl Default for FOLLOW_TARGET_DATA {
11894 fn default() -> Self {
11895 Self::DEFAULT.clone()
11896 }
11897}
11898impl MessageData for FOLLOW_TARGET_DATA {
11899 type Message = MavMessage;
11900 const ID: u32 = 144u32;
11901 const NAME: &'static str = "FOLLOW_TARGET";
11902 const EXTRA_CRC: u8 = 127u8;
11903 const ENCODED_LEN: usize = 93usize;
11904 fn deser(
11905 _version: MavlinkVersion,
11906 __input: &[u8],
11907 ) -> Result<Self, ::mavlink_core::error::ParserError> {
11908 let avail_len = __input.len();
11909 let mut payload_buf = [0; Self::ENCODED_LEN];
11910 let mut buf = if avail_len < Self::ENCODED_LEN {
11911 payload_buf[0..avail_len].copy_from_slice(__input);
11912 Bytes::new(&payload_buf)
11913 } else {
11914 Bytes::new(__input)
11915 };
11916 let mut __struct = Self::default();
11917 __struct.timestamp = buf.get_u64_le();
11918 __struct.custom_state = buf.get_u64_le();
11919 __struct.lat = buf.get_i32_le();
11920 __struct.lon = buf.get_i32_le();
11921 __struct.alt = buf.get_f32_le();
11922 for v in &mut __struct.vel {
11923 let val = buf.get_f32_le();
11924 *v = val;
11925 }
11926 for v in &mut __struct.acc {
11927 let val = buf.get_f32_le();
11928 *v = val;
11929 }
11930 for v in &mut __struct.attitude_q {
11931 let val = buf.get_f32_le();
11932 *v = val;
11933 }
11934 for v in &mut __struct.rates {
11935 let val = buf.get_f32_le();
11936 *v = val;
11937 }
11938 for v in &mut __struct.position_cov {
11939 let val = buf.get_f32_le();
11940 *v = val;
11941 }
11942 __struct.est_capabilities = buf.get_u8();
11943 Ok(__struct)
11944 }
11945 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
11946 let mut __tmp = BytesMut::new(bytes);
11947 #[allow(clippy::absurd_extreme_comparisons)]
11948 #[allow(unused_comparisons)]
11949 if __tmp.remaining() < Self::ENCODED_LEN {
11950 panic!(
11951 "buffer is too small (need {} bytes, but got {})",
11952 Self::ENCODED_LEN,
11953 __tmp.remaining(),
11954 )
11955 }
11956 __tmp.put_u64_le(self.timestamp);
11957 __tmp.put_u64_le(self.custom_state);
11958 __tmp.put_i32_le(self.lat);
11959 __tmp.put_i32_le(self.lon);
11960 __tmp.put_f32_le(self.alt);
11961 for val in &self.vel {
11962 __tmp.put_f32_le(*val);
11963 }
11964 for val in &self.acc {
11965 __tmp.put_f32_le(*val);
11966 }
11967 for val in &self.attitude_q {
11968 __tmp.put_f32_le(*val);
11969 }
11970 for val in &self.rates {
11971 __tmp.put_f32_le(*val);
11972 }
11973 for val in &self.position_cov {
11974 __tmp.put_f32_le(*val);
11975 }
11976 __tmp.put_u8(self.est_capabilities);
11977 if matches!(version, MavlinkVersion::V2) {
11978 let len = __tmp.len();
11979 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
11980 } else {
11981 __tmp.len()
11982 }
11983 }
11984}
11985#[doc = "Fuel status. This message provides \"generic\" fuel level information for in a GCS and for triggering failsafes in an autopilot. The fuel type and associated units for fields in this message are defined in the enum MAV_FUEL_TYPE. The reported `consumed_fuel` and `remaining_fuel` must only be supplied if measured: they must not be inferred from the `maximum_fuel` and the other value. A recipient can assume that if these fields are supplied they are accurate. If not provided, the recipient can infer `remaining_fuel` from `maximum_fuel` and `consumed_fuel` on the assumption that the fuel was initially at its maximum (this is what battery monitors assume). Note however that this is an assumption, and the UI should prompt the user appropriately (i.e. notify user that they should fill the tank before boot). This kind of information may also be sent in fuel-specific messages such as BATTERY_STATUS_V2. If both messages are sent for the same fuel system, the ids and corresponding information must match. This should be streamed (nominally at 0.1 Hz)."]
11986#[doc = ""]
11987#[doc = "ID: 371"]
11988#[derive(Debug, Clone, PartialEq)]
11989#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
11990#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
11991#[cfg_attr(feature = "ts", derive(TS))]
11992#[cfg_attr(feature = "ts", ts(export))]
11993pub struct FUEL_STATUS_DATA {
11994 #[doc = "Capacity when full. Must be provided."]
11995 pub maximum_fuel: f32,
11996 #[doc = "Consumed fuel (measured). This value should not be inferred: if not measured set to NaN. NaN: field not provided."]
11997 pub consumed_fuel: f32,
11998 #[doc = "Remaining fuel until empty (measured). The value should not be inferred: if not measured set to NaN. NaN: field not provided."]
11999 pub remaining_fuel: f32,
12000 #[doc = "Positive value when emptying/using, and negative if filling/replacing. NaN: field not provided."]
12001 pub flow_rate: f32,
12002 #[doc = "Fuel temperature. NaN: field not provided."]
12003 pub temperature: f32,
12004 #[doc = "Fuel type. Defines units for fuel capacity and consumption fields above."]
12005 pub fuel_type: MavFuelType,
12006 #[doc = "Fuel ID. Must match ID of other messages for same fuel system, such as BATTERY_STATUS_V2."]
12007 pub id: u8,
12008 #[doc = "Percentage of remaining fuel, relative to full. Values: [0-100], UINT8_MAX: field not provided."]
12009 pub percent_remaining: u8,
12010}
12011impl FUEL_STATUS_DATA {
12012 pub const ENCODED_LEN: usize = 26usize;
12013 pub const DEFAULT: Self = Self {
12014 maximum_fuel: 0.0_f32,
12015 consumed_fuel: 0.0_f32,
12016 remaining_fuel: 0.0_f32,
12017 flow_rate: 0.0_f32,
12018 temperature: 0.0_f32,
12019 fuel_type: MavFuelType::DEFAULT,
12020 id: 0_u8,
12021 percent_remaining: 0_u8,
12022 };
12023 #[cfg(feature = "arbitrary")]
12024 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
12025 use arbitrary::{Arbitrary, Unstructured};
12026 let mut buf = [0u8; 1024];
12027 rng.fill_bytes(&mut buf);
12028 let mut unstructured = Unstructured::new(&buf);
12029 Self::arbitrary(&mut unstructured).unwrap_or_default()
12030 }
12031}
12032impl Default for FUEL_STATUS_DATA {
12033 fn default() -> Self {
12034 Self::DEFAULT.clone()
12035 }
12036}
12037impl MessageData for FUEL_STATUS_DATA {
12038 type Message = MavMessage;
12039 const ID: u32 = 371u32;
12040 const NAME: &'static str = "FUEL_STATUS";
12041 const EXTRA_CRC: u8 = 10u8;
12042 const ENCODED_LEN: usize = 26usize;
12043 fn deser(
12044 _version: MavlinkVersion,
12045 __input: &[u8],
12046 ) -> Result<Self, ::mavlink_core::error::ParserError> {
12047 let avail_len = __input.len();
12048 let mut payload_buf = [0; Self::ENCODED_LEN];
12049 let mut buf = if avail_len < Self::ENCODED_LEN {
12050 payload_buf[0..avail_len].copy_from_slice(__input);
12051 Bytes::new(&payload_buf)
12052 } else {
12053 Bytes::new(__input)
12054 };
12055 let mut __struct = Self::default();
12056 __struct.maximum_fuel = buf.get_f32_le();
12057 __struct.consumed_fuel = buf.get_f32_le();
12058 __struct.remaining_fuel = buf.get_f32_le();
12059 __struct.flow_rate = buf.get_f32_le();
12060 __struct.temperature = buf.get_f32_le();
12061 let tmp = buf.get_u32_le();
12062 __struct.fuel_type = FromPrimitive::from_u32(tmp).ok_or(
12063 ::mavlink_core::error::ParserError::InvalidEnum {
12064 enum_type: "MavFuelType",
12065 value: tmp as u64,
12066 },
12067 )?;
12068 __struct.id = buf.get_u8();
12069 __struct.percent_remaining = buf.get_u8();
12070 Ok(__struct)
12071 }
12072 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
12073 let mut __tmp = BytesMut::new(bytes);
12074 #[allow(clippy::absurd_extreme_comparisons)]
12075 #[allow(unused_comparisons)]
12076 if __tmp.remaining() < Self::ENCODED_LEN {
12077 panic!(
12078 "buffer is too small (need {} bytes, but got {})",
12079 Self::ENCODED_LEN,
12080 __tmp.remaining(),
12081 )
12082 }
12083 __tmp.put_f32_le(self.maximum_fuel);
12084 __tmp.put_f32_le(self.consumed_fuel);
12085 __tmp.put_f32_le(self.remaining_fuel);
12086 __tmp.put_f32_le(self.flow_rate);
12087 __tmp.put_f32_le(self.temperature);
12088 __tmp.put_u32_le(self.fuel_type as u32);
12089 __tmp.put_u8(self.id);
12090 __tmp.put_u8(self.percent_remaining);
12091 if matches!(version, MavlinkVersion::V2) {
12092 let len = __tmp.len();
12093 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
12094 } else {
12095 __tmp.len()
12096 }
12097 }
12098}
12099#[doc = "Telemetry of power generation system. Alternator or mechanical generator."]
12100#[doc = ""]
12101#[doc = "ID: 373"]
12102#[derive(Debug, Clone, PartialEq)]
12103#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
12104#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
12105#[cfg_attr(feature = "ts", derive(TS))]
12106#[cfg_attr(feature = "ts", ts(export))]
12107pub struct GENERATOR_STATUS_DATA {
12108 #[doc = "Status flags."]
12109 pub status: MavGeneratorStatusFlag,
12110 #[doc = "Current into/out of battery. Positive for out. Negative for in. NaN: field not provided."]
12111 pub battery_current: f32,
12112 #[doc = "Current going to the UAV. If battery current not available this is the DC current from the generator. Positive for out. Negative for in. NaN: field not provided"]
12113 pub load_current: f32,
12114 #[doc = "The power being generated. NaN: field not provided"]
12115 pub power_generated: f32,
12116 #[doc = "Voltage of the bus seen at the generator, or battery bus if battery bus is controlled by generator and at a different voltage to main bus."]
12117 pub bus_voltage: f32,
12118 #[doc = "The target battery current. Positive for out. Negative for in. NaN: field not provided"]
12119 pub bat_current_setpoint: f32,
12120 #[doc = "Seconds this generator has run since it was rebooted. UINT32_MAX: field not provided."]
12121 pub runtime: u32,
12122 #[doc = "Seconds until this generator requires maintenance. A negative value indicates maintenance is past-due. INT32_MAX: field not provided."]
12123 pub time_until_maintenance: i32,
12124 #[doc = "Speed of electrical generator or alternator. UINT16_MAX: field not provided."]
12125 pub generator_speed: u16,
12126 #[doc = "The temperature of the rectifier or power converter. INT16_MAX: field not provided."]
12127 pub rectifier_temperature: i16,
12128 #[doc = "The temperature of the mechanical motor, fuel cell core or generator. INT16_MAX: field not provided."]
12129 pub generator_temperature: i16,
12130}
12131impl GENERATOR_STATUS_DATA {
12132 pub const ENCODED_LEN: usize = 42usize;
12133 pub const DEFAULT: Self = Self {
12134 status: MavGeneratorStatusFlag::DEFAULT,
12135 battery_current: 0.0_f32,
12136 load_current: 0.0_f32,
12137 power_generated: 0.0_f32,
12138 bus_voltage: 0.0_f32,
12139 bat_current_setpoint: 0.0_f32,
12140 runtime: 0_u32,
12141 time_until_maintenance: 0_i32,
12142 generator_speed: 0_u16,
12143 rectifier_temperature: 0_i16,
12144 generator_temperature: 0_i16,
12145 };
12146 #[cfg(feature = "arbitrary")]
12147 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
12148 use arbitrary::{Arbitrary, Unstructured};
12149 let mut buf = [0u8; 1024];
12150 rng.fill_bytes(&mut buf);
12151 let mut unstructured = Unstructured::new(&buf);
12152 Self::arbitrary(&mut unstructured).unwrap_or_default()
12153 }
12154}
12155impl Default for GENERATOR_STATUS_DATA {
12156 fn default() -> Self {
12157 Self::DEFAULT.clone()
12158 }
12159}
12160impl MessageData for GENERATOR_STATUS_DATA {
12161 type Message = MavMessage;
12162 const ID: u32 = 373u32;
12163 const NAME: &'static str = "GENERATOR_STATUS";
12164 const EXTRA_CRC: u8 = 117u8;
12165 const ENCODED_LEN: usize = 42usize;
12166 fn deser(
12167 _version: MavlinkVersion,
12168 __input: &[u8],
12169 ) -> Result<Self, ::mavlink_core::error::ParserError> {
12170 let avail_len = __input.len();
12171 let mut payload_buf = [0; Self::ENCODED_LEN];
12172 let mut buf = if avail_len < Self::ENCODED_LEN {
12173 payload_buf[0..avail_len].copy_from_slice(__input);
12174 Bytes::new(&payload_buf)
12175 } else {
12176 Bytes::new(__input)
12177 };
12178 let mut __struct = Self::default();
12179 let tmp = buf.get_u64_le();
12180 __struct.status =
12181 MavGeneratorStatusFlag::from_bits(tmp as <MavGeneratorStatusFlag as Flags>::Bits)
12182 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
12183 flag_type: "MavGeneratorStatusFlag",
12184 value: tmp as u64,
12185 })?;
12186 __struct.battery_current = buf.get_f32_le();
12187 __struct.load_current = buf.get_f32_le();
12188 __struct.power_generated = buf.get_f32_le();
12189 __struct.bus_voltage = buf.get_f32_le();
12190 __struct.bat_current_setpoint = buf.get_f32_le();
12191 __struct.runtime = buf.get_u32_le();
12192 __struct.time_until_maintenance = buf.get_i32_le();
12193 __struct.generator_speed = buf.get_u16_le();
12194 __struct.rectifier_temperature = buf.get_i16_le();
12195 __struct.generator_temperature = buf.get_i16_le();
12196 Ok(__struct)
12197 }
12198 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
12199 let mut __tmp = BytesMut::new(bytes);
12200 #[allow(clippy::absurd_extreme_comparisons)]
12201 #[allow(unused_comparisons)]
12202 if __tmp.remaining() < Self::ENCODED_LEN {
12203 panic!(
12204 "buffer is too small (need {} bytes, but got {})",
12205 Self::ENCODED_LEN,
12206 __tmp.remaining(),
12207 )
12208 }
12209 __tmp.put_u64_le(self.status.bits() as u64);
12210 __tmp.put_f32_le(self.battery_current);
12211 __tmp.put_f32_le(self.load_current);
12212 __tmp.put_f32_le(self.power_generated);
12213 __tmp.put_f32_le(self.bus_voltage);
12214 __tmp.put_f32_le(self.bat_current_setpoint);
12215 __tmp.put_u32_le(self.runtime);
12216 __tmp.put_i32_le(self.time_until_maintenance);
12217 __tmp.put_u16_le(self.generator_speed);
12218 __tmp.put_i16_le(self.rectifier_temperature);
12219 __tmp.put_i16_le(self.generator_temperature);
12220 if matches!(version, MavlinkVersion::V2) {
12221 let len = __tmp.len();
12222 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
12223 } else {
12224 __tmp.len()
12225 }
12226 }
12227}
12228#[doc = "Message reporting the status of a gimbal device. \t This message should be broadcast by a gimbal device component at a low regular rate (e.g. 5 Hz). \t For the angles encoded in the quaternion and the angular velocities holds: \t If the flag GIMBAL_DEVICE_FLAGS_YAW_IN_VEHICLE_FRAME is set, then they are relative to the vehicle heading (vehicle frame). \t If the flag GIMBAL_DEVICE_FLAGS_YAW_IN_EARTH_FRAME is set, then they are relative to absolute North (earth frame). \t If neither of these flags are set, then (for backwards compatibility) it holds: \t If the flag GIMBAL_DEVICE_FLAGS_YAW_LOCK is set, then they are relative to absolute North (earth frame), \t else they are relative to the vehicle heading (vehicle frame). \t Other conditions of the flags are not allowed. \t The quaternion and angular velocities in the other frame can be calculated from delta_yaw and delta_yaw_velocity as \t q_earth = q_delta_yaw * q_vehicle and w_earth = w_delta_yaw_velocity + w_vehicle (if not NaN). \t If neither the GIMBAL_DEVICE_FLAGS_YAW_IN_VEHICLE_FRAME nor the GIMBAL_DEVICE_FLAGS_YAW_IN_EARTH_FRAME flag is set, \t then (for backwards compatibility) the data in the delta_yaw and delta_yaw_velocity fields are to be ignored. \t New implementations should always set either GIMBAL_DEVICE_FLAGS_YAW_IN_VEHICLE_FRAME or GIMBAL_DEVICE_FLAGS_YAW_IN_EARTH_FRAME, \t and always should set delta_yaw and delta_yaw_velocity either to the proper value or NaN."]
12229#[doc = ""]
12230#[doc = "ID: 285"]
12231#[derive(Debug, Clone, PartialEq)]
12232#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
12233#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
12234#[cfg_attr(feature = "ts", derive(TS))]
12235#[cfg_attr(feature = "ts", ts(export))]
12236pub struct GIMBAL_DEVICE_ATTITUDE_STATUS_DATA {
12237 #[doc = "Timestamp (time since system boot)."]
12238 pub time_boot_ms: u32,
12239 #[doc = "Quaternion components, w, x, y, z (1 0 0 0 is the null-rotation). The frame is described in the message description."]
12240 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
12241 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
12242 pub q: [f32; 4],
12243 #[doc = "X component of angular velocity (positive: rolling to the right). The frame is described in the message description. NaN if unknown."]
12244 pub angular_velocity_x: f32,
12245 #[doc = "Y component of angular velocity (positive: pitching up). The frame is described in the message description. NaN if unknown."]
12246 pub angular_velocity_y: f32,
12247 #[doc = "Z component of angular velocity (positive: yawing to the right). The frame is described in the message description. NaN if unknown."]
12248 pub angular_velocity_z: f32,
12249 #[doc = "Failure flags (0 for no failure)"]
12250 pub failure_flags: GimbalDeviceErrorFlags,
12251 #[doc = "Current gimbal flags set."]
12252 pub flags: GimbalDeviceFlags,
12253 #[doc = "System ID"]
12254 pub target_system: u8,
12255 #[doc = "Component ID"]
12256 pub target_component: u8,
12257 #[doc = "Yaw angle relating the quaternions in earth and body frames (see message description). NaN if unknown."]
12258 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
12259 pub delta_yaw: f32,
12260 #[doc = "Yaw angular velocity relating the angular velocities in earth and body frames (see message description). NaN if unknown."]
12261 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
12262 pub delta_yaw_velocity: f32,
12263 #[doc = "This field is to be used if the gimbal manager and the gimbal device are the same component and hence have the same component ID. This field is then set a number between 1-6. If the component ID is separate, this field is not required and must be set to 0."]
12264 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
12265 pub gimbal_device_id: u8,
12266}
12267impl GIMBAL_DEVICE_ATTITUDE_STATUS_DATA {
12268 pub const ENCODED_LEN: usize = 49usize;
12269 pub const DEFAULT: Self = Self {
12270 time_boot_ms: 0_u32,
12271 q: [0.0_f32; 4usize],
12272 angular_velocity_x: 0.0_f32,
12273 angular_velocity_y: 0.0_f32,
12274 angular_velocity_z: 0.0_f32,
12275 failure_flags: GimbalDeviceErrorFlags::DEFAULT,
12276 flags: GimbalDeviceFlags::DEFAULT,
12277 target_system: 0_u8,
12278 target_component: 0_u8,
12279 delta_yaw: 0.0_f32,
12280 delta_yaw_velocity: 0.0_f32,
12281 gimbal_device_id: 0_u8,
12282 };
12283 #[cfg(feature = "arbitrary")]
12284 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
12285 use arbitrary::{Arbitrary, Unstructured};
12286 let mut buf = [0u8; 1024];
12287 rng.fill_bytes(&mut buf);
12288 let mut unstructured = Unstructured::new(&buf);
12289 Self::arbitrary(&mut unstructured).unwrap_or_default()
12290 }
12291}
12292impl Default for GIMBAL_DEVICE_ATTITUDE_STATUS_DATA {
12293 fn default() -> Self {
12294 Self::DEFAULT.clone()
12295 }
12296}
12297impl MessageData for GIMBAL_DEVICE_ATTITUDE_STATUS_DATA {
12298 type Message = MavMessage;
12299 const ID: u32 = 285u32;
12300 const NAME: &'static str = "GIMBAL_DEVICE_ATTITUDE_STATUS";
12301 const EXTRA_CRC: u8 = 137u8;
12302 const ENCODED_LEN: usize = 49usize;
12303 fn deser(
12304 _version: MavlinkVersion,
12305 __input: &[u8],
12306 ) -> Result<Self, ::mavlink_core::error::ParserError> {
12307 let avail_len = __input.len();
12308 let mut payload_buf = [0; Self::ENCODED_LEN];
12309 let mut buf = if avail_len < Self::ENCODED_LEN {
12310 payload_buf[0..avail_len].copy_from_slice(__input);
12311 Bytes::new(&payload_buf)
12312 } else {
12313 Bytes::new(__input)
12314 };
12315 let mut __struct = Self::default();
12316 __struct.time_boot_ms = buf.get_u32_le();
12317 for v in &mut __struct.q {
12318 let val = buf.get_f32_le();
12319 *v = val;
12320 }
12321 __struct.angular_velocity_x = buf.get_f32_le();
12322 __struct.angular_velocity_y = buf.get_f32_le();
12323 __struct.angular_velocity_z = buf.get_f32_le();
12324 let tmp = buf.get_u32_le();
12325 __struct.failure_flags =
12326 GimbalDeviceErrorFlags::from_bits(tmp as <GimbalDeviceErrorFlags as Flags>::Bits)
12327 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
12328 flag_type: "GimbalDeviceErrorFlags",
12329 value: tmp as u64,
12330 })?;
12331 let tmp = buf.get_u16_le();
12332 __struct.flags = GimbalDeviceFlags::from_bits(tmp as <GimbalDeviceFlags as Flags>::Bits)
12333 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
12334 flag_type: "GimbalDeviceFlags",
12335 value: tmp as u64,
12336 })?;
12337 __struct.target_system = buf.get_u8();
12338 __struct.target_component = buf.get_u8();
12339 __struct.delta_yaw = buf.get_f32_le();
12340 __struct.delta_yaw_velocity = buf.get_f32_le();
12341 __struct.gimbal_device_id = buf.get_u8();
12342 Ok(__struct)
12343 }
12344 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
12345 let mut __tmp = BytesMut::new(bytes);
12346 #[allow(clippy::absurd_extreme_comparisons)]
12347 #[allow(unused_comparisons)]
12348 if __tmp.remaining() < Self::ENCODED_LEN {
12349 panic!(
12350 "buffer is too small (need {} bytes, but got {})",
12351 Self::ENCODED_LEN,
12352 __tmp.remaining(),
12353 )
12354 }
12355 __tmp.put_u32_le(self.time_boot_ms);
12356 for val in &self.q {
12357 __tmp.put_f32_le(*val);
12358 }
12359 __tmp.put_f32_le(self.angular_velocity_x);
12360 __tmp.put_f32_le(self.angular_velocity_y);
12361 __tmp.put_f32_le(self.angular_velocity_z);
12362 __tmp.put_u32_le(self.failure_flags.bits() as u32);
12363 __tmp.put_u16_le(self.flags.bits() as u16);
12364 __tmp.put_u8(self.target_system);
12365 __tmp.put_u8(self.target_component);
12366 if matches!(version, MavlinkVersion::V2) {
12367 __tmp.put_f32_le(self.delta_yaw);
12368 __tmp.put_f32_le(self.delta_yaw_velocity);
12369 __tmp.put_u8(self.gimbal_device_id);
12370 let len = __tmp.len();
12371 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
12372 } else {
12373 __tmp.len()
12374 }
12375 }
12376}
12377#[doc = "Information about a low level gimbal. This message should be requested by the gimbal manager or a ground station using MAV_CMD_REQUEST_MESSAGE. The maximum angles and rates are the limits by hardware. However, the limits by software used are likely different/smaller and dependent on mode/settings/etc.."]
12378#[doc = ""]
12379#[doc = "ID: 283"]
12380#[derive(Debug, Clone, PartialEq)]
12381#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
12382#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
12383#[cfg_attr(feature = "ts", derive(TS))]
12384#[cfg_attr(feature = "ts", ts(export))]
12385pub struct GIMBAL_DEVICE_INFORMATION_DATA {
12386 #[doc = "UID of gimbal hardware (0 if unknown)."]
12387 pub uid: u64,
12388 #[doc = "Timestamp (time since system boot)."]
12389 pub time_boot_ms: u32,
12390 #[doc = "0xff)."]
12391 pub firmware_version: u32,
12392 #[doc = "0xff)."]
12393 pub hardware_version: u32,
12394 #[doc = "Minimum hardware roll angle (positive: rolling to the right, negative: rolling to the left). NAN if unknown."]
12395 pub roll_min: f32,
12396 #[doc = "Maximum hardware roll angle (positive: rolling to the right, negative: rolling to the left). NAN if unknown."]
12397 pub roll_max: f32,
12398 #[doc = "Minimum hardware pitch angle (positive: up, negative: down). NAN if unknown."]
12399 pub pitch_min: f32,
12400 #[doc = "Maximum hardware pitch angle (positive: up, negative: down). NAN if unknown."]
12401 pub pitch_max: f32,
12402 #[doc = "Minimum hardware yaw angle (positive: to the right, negative: to the left). NAN if unknown."]
12403 pub yaw_min: f32,
12404 #[doc = "Maximum hardware yaw angle (positive: to the right, negative: to the left). NAN if unknown."]
12405 pub yaw_max: f32,
12406 #[doc = "Bitmap of gimbal capability flags."]
12407 pub cap_flags: GimbalDeviceCapFlags,
12408 #[doc = "Bitmap for use for gimbal-specific capability flags."]
12409 pub custom_cap_flags: u16,
12410 #[doc = "Name of the gimbal vendor."]
12411 #[cfg_attr(feature = "ts", ts(type = "string"))]
12412 pub vendor_name: CharArray<32>,
12413 #[doc = "Name of the gimbal model."]
12414 #[cfg_attr(feature = "ts", ts(type = "string"))]
12415 pub model_name: CharArray<32>,
12416 #[doc = "Custom name of the gimbal given to it by the user."]
12417 #[cfg_attr(feature = "ts", ts(type = "string"))]
12418 pub custom_name: CharArray<32>,
12419 #[doc = "This field is to be used if the gimbal manager and the gimbal device are the same component and hence have the same component ID. This field is then set to a number between 1-6. If the component ID is separate, this field is not required and must be set to 0."]
12420 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
12421 pub gimbal_device_id: u8,
12422}
12423impl GIMBAL_DEVICE_INFORMATION_DATA {
12424 pub const ENCODED_LEN: usize = 145usize;
12425 pub const DEFAULT: Self = Self {
12426 uid: 0_u64,
12427 time_boot_ms: 0_u32,
12428 firmware_version: 0_u32,
12429 hardware_version: 0_u32,
12430 roll_min: 0.0_f32,
12431 roll_max: 0.0_f32,
12432 pitch_min: 0.0_f32,
12433 pitch_max: 0.0_f32,
12434 yaw_min: 0.0_f32,
12435 yaw_max: 0.0_f32,
12436 cap_flags: GimbalDeviceCapFlags::DEFAULT,
12437 custom_cap_flags: 0_u16,
12438 vendor_name: CharArray::new([0_u8; 32usize]),
12439 model_name: CharArray::new([0_u8; 32usize]),
12440 custom_name: CharArray::new([0_u8; 32usize]),
12441 gimbal_device_id: 0_u8,
12442 };
12443 #[cfg(feature = "arbitrary")]
12444 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
12445 use arbitrary::{Arbitrary, Unstructured};
12446 let mut buf = [0u8; 1024];
12447 rng.fill_bytes(&mut buf);
12448 let mut unstructured = Unstructured::new(&buf);
12449 Self::arbitrary(&mut unstructured).unwrap_or_default()
12450 }
12451}
12452impl Default for GIMBAL_DEVICE_INFORMATION_DATA {
12453 fn default() -> Self {
12454 Self::DEFAULT.clone()
12455 }
12456}
12457impl MessageData for GIMBAL_DEVICE_INFORMATION_DATA {
12458 type Message = MavMessage;
12459 const ID: u32 = 283u32;
12460 const NAME: &'static str = "GIMBAL_DEVICE_INFORMATION";
12461 const EXTRA_CRC: u8 = 74u8;
12462 const ENCODED_LEN: usize = 145usize;
12463 fn deser(
12464 _version: MavlinkVersion,
12465 __input: &[u8],
12466 ) -> Result<Self, ::mavlink_core::error::ParserError> {
12467 let avail_len = __input.len();
12468 let mut payload_buf = [0; Self::ENCODED_LEN];
12469 let mut buf = if avail_len < Self::ENCODED_LEN {
12470 payload_buf[0..avail_len].copy_from_slice(__input);
12471 Bytes::new(&payload_buf)
12472 } else {
12473 Bytes::new(__input)
12474 };
12475 let mut __struct = Self::default();
12476 __struct.uid = buf.get_u64_le();
12477 __struct.time_boot_ms = buf.get_u32_le();
12478 __struct.firmware_version = buf.get_u32_le();
12479 __struct.hardware_version = buf.get_u32_le();
12480 __struct.roll_min = buf.get_f32_le();
12481 __struct.roll_max = buf.get_f32_le();
12482 __struct.pitch_min = buf.get_f32_le();
12483 __struct.pitch_max = buf.get_f32_le();
12484 __struct.yaw_min = buf.get_f32_le();
12485 __struct.yaw_max = buf.get_f32_le();
12486 let tmp = buf.get_u16_le();
12487 __struct.cap_flags = GimbalDeviceCapFlags::from_bits(
12488 tmp as <GimbalDeviceCapFlags as Flags>::Bits,
12489 )
12490 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
12491 flag_type: "GimbalDeviceCapFlags",
12492 value: tmp as u64,
12493 })?;
12494 __struct.custom_cap_flags = buf.get_u16_le();
12495 let mut tmp = [0_u8; 32usize];
12496 for v in &mut tmp {
12497 *v = buf.get_u8();
12498 }
12499 __struct.vendor_name = CharArray::new(tmp);
12500 let mut tmp = [0_u8; 32usize];
12501 for v in &mut tmp {
12502 *v = buf.get_u8();
12503 }
12504 __struct.model_name = CharArray::new(tmp);
12505 let mut tmp = [0_u8; 32usize];
12506 for v in &mut tmp {
12507 *v = buf.get_u8();
12508 }
12509 __struct.custom_name = CharArray::new(tmp);
12510 __struct.gimbal_device_id = buf.get_u8();
12511 Ok(__struct)
12512 }
12513 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
12514 let mut __tmp = BytesMut::new(bytes);
12515 #[allow(clippy::absurd_extreme_comparisons)]
12516 #[allow(unused_comparisons)]
12517 if __tmp.remaining() < Self::ENCODED_LEN {
12518 panic!(
12519 "buffer is too small (need {} bytes, but got {})",
12520 Self::ENCODED_LEN,
12521 __tmp.remaining(),
12522 )
12523 }
12524 __tmp.put_u64_le(self.uid);
12525 __tmp.put_u32_le(self.time_boot_ms);
12526 __tmp.put_u32_le(self.firmware_version);
12527 __tmp.put_u32_le(self.hardware_version);
12528 __tmp.put_f32_le(self.roll_min);
12529 __tmp.put_f32_le(self.roll_max);
12530 __tmp.put_f32_le(self.pitch_min);
12531 __tmp.put_f32_le(self.pitch_max);
12532 __tmp.put_f32_le(self.yaw_min);
12533 __tmp.put_f32_le(self.yaw_max);
12534 __tmp.put_u16_le(self.cap_flags.bits() as u16);
12535 __tmp.put_u16_le(self.custom_cap_flags);
12536 for val in &self.vendor_name {
12537 __tmp.put_u8(*val);
12538 }
12539 for val in &self.model_name {
12540 __tmp.put_u8(*val);
12541 }
12542 for val in &self.custom_name {
12543 __tmp.put_u8(*val);
12544 }
12545 if matches!(version, MavlinkVersion::V2) {
12546 __tmp.put_u8(self.gimbal_device_id);
12547 let len = __tmp.len();
12548 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
12549 } else {
12550 __tmp.len()
12551 }
12552 }
12553}
12554#[doc = "Low level message to control a gimbal device's attitude. \t This message is to be sent from the gimbal manager to the gimbal device component. \t The quaternion and angular velocities can be set to NaN according to use case. \t For the angles encoded in the quaternion and the angular velocities holds: \t If the flag GIMBAL_DEVICE_FLAGS_YAW_IN_VEHICLE_FRAME is set, then they are relative to the vehicle heading (vehicle frame). \t If the flag GIMBAL_DEVICE_FLAGS_YAW_IN_EARTH_FRAME is set, then they are relative to absolute North (earth frame). \t If neither of these flags are set, then (for backwards compatibility) it holds: \t If the flag GIMBAL_DEVICE_FLAGS_YAW_LOCK is set, then they are relative to absolute North (earth frame), \t else they are relative to the vehicle heading (vehicle frame). \t Setting both GIMBAL_DEVICE_FLAGS_YAW_IN_VEHICLE_FRAME and GIMBAL_DEVICE_FLAGS_YAW_IN_EARTH_FRAME is not allowed. \t These rules are to ensure backwards compatibility. \t New implementations should always set either GIMBAL_DEVICE_FLAGS_YAW_IN_VEHICLE_FRAME or GIMBAL_DEVICE_FLAGS_YAW_IN_EARTH_FRAME."]
12555#[doc = ""]
12556#[doc = "ID: 284"]
12557#[derive(Debug, Clone, PartialEq)]
12558#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
12559#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
12560#[cfg_attr(feature = "ts", derive(TS))]
12561#[cfg_attr(feature = "ts", ts(export))]
12562pub struct GIMBAL_DEVICE_SET_ATTITUDE_DATA {
12563 #[doc = "Quaternion components, w, x, y, z (1 0 0 0 is the null-rotation). The frame is described in the message description. Set fields to NaN to be ignored."]
12564 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
12565 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
12566 pub q: [f32; 4],
12567 #[doc = "X component of angular velocity (positive: rolling to the right). The frame is described in the message description. NaN to be ignored."]
12568 pub angular_velocity_x: f32,
12569 #[doc = "Y component of angular velocity (positive: pitching up). The frame is described in the message description. NaN to be ignored."]
12570 pub angular_velocity_y: f32,
12571 #[doc = "Z component of angular velocity (positive: yawing to the right). The frame is described in the message description. NaN to be ignored."]
12572 pub angular_velocity_z: f32,
12573 #[doc = "Low level gimbal flags."]
12574 pub flags: GimbalDeviceFlags,
12575 #[doc = "System ID"]
12576 pub target_system: u8,
12577 #[doc = "Component ID"]
12578 pub target_component: u8,
12579}
12580impl GIMBAL_DEVICE_SET_ATTITUDE_DATA {
12581 pub const ENCODED_LEN: usize = 32usize;
12582 pub const DEFAULT: Self = Self {
12583 q: [0.0_f32; 4usize],
12584 angular_velocity_x: 0.0_f32,
12585 angular_velocity_y: 0.0_f32,
12586 angular_velocity_z: 0.0_f32,
12587 flags: GimbalDeviceFlags::DEFAULT,
12588 target_system: 0_u8,
12589 target_component: 0_u8,
12590 };
12591 #[cfg(feature = "arbitrary")]
12592 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
12593 use arbitrary::{Arbitrary, Unstructured};
12594 let mut buf = [0u8; 1024];
12595 rng.fill_bytes(&mut buf);
12596 let mut unstructured = Unstructured::new(&buf);
12597 Self::arbitrary(&mut unstructured).unwrap_or_default()
12598 }
12599}
12600impl Default for GIMBAL_DEVICE_SET_ATTITUDE_DATA {
12601 fn default() -> Self {
12602 Self::DEFAULT.clone()
12603 }
12604}
12605impl MessageData for GIMBAL_DEVICE_SET_ATTITUDE_DATA {
12606 type Message = MavMessage;
12607 const ID: u32 = 284u32;
12608 const NAME: &'static str = "GIMBAL_DEVICE_SET_ATTITUDE";
12609 const EXTRA_CRC: u8 = 99u8;
12610 const ENCODED_LEN: usize = 32usize;
12611 fn deser(
12612 _version: MavlinkVersion,
12613 __input: &[u8],
12614 ) -> Result<Self, ::mavlink_core::error::ParserError> {
12615 let avail_len = __input.len();
12616 let mut payload_buf = [0; Self::ENCODED_LEN];
12617 let mut buf = if avail_len < Self::ENCODED_LEN {
12618 payload_buf[0..avail_len].copy_from_slice(__input);
12619 Bytes::new(&payload_buf)
12620 } else {
12621 Bytes::new(__input)
12622 };
12623 let mut __struct = Self::default();
12624 for v in &mut __struct.q {
12625 let val = buf.get_f32_le();
12626 *v = val;
12627 }
12628 __struct.angular_velocity_x = buf.get_f32_le();
12629 __struct.angular_velocity_y = buf.get_f32_le();
12630 __struct.angular_velocity_z = buf.get_f32_le();
12631 let tmp = buf.get_u16_le();
12632 __struct.flags = GimbalDeviceFlags::from_bits(tmp as <GimbalDeviceFlags as Flags>::Bits)
12633 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
12634 flag_type: "GimbalDeviceFlags",
12635 value: tmp as u64,
12636 })?;
12637 __struct.target_system = buf.get_u8();
12638 __struct.target_component = buf.get_u8();
12639 Ok(__struct)
12640 }
12641 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
12642 let mut __tmp = BytesMut::new(bytes);
12643 #[allow(clippy::absurd_extreme_comparisons)]
12644 #[allow(unused_comparisons)]
12645 if __tmp.remaining() < Self::ENCODED_LEN {
12646 panic!(
12647 "buffer is too small (need {} bytes, but got {})",
12648 Self::ENCODED_LEN,
12649 __tmp.remaining(),
12650 )
12651 }
12652 for val in &self.q {
12653 __tmp.put_f32_le(*val);
12654 }
12655 __tmp.put_f32_le(self.angular_velocity_x);
12656 __tmp.put_f32_le(self.angular_velocity_y);
12657 __tmp.put_f32_le(self.angular_velocity_z);
12658 __tmp.put_u16_le(self.flags.bits() as u16);
12659 __tmp.put_u8(self.target_system);
12660 __tmp.put_u8(self.target_component);
12661 if matches!(version, MavlinkVersion::V2) {
12662 let len = __tmp.len();
12663 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
12664 } else {
12665 __tmp.len()
12666 }
12667 }
12668}
12669#[doc = "Information about a high level gimbal manager. This message should be requested by a ground station using MAV_CMD_REQUEST_MESSAGE."]
12670#[doc = ""]
12671#[doc = "ID: 280"]
12672#[derive(Debug, Clone, PartialEq)]
12673#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
12674#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
12675#[cfg_attr(feature = "ts", derive(TS))]
12676#[cfg_attr(feature = "ts", ts(export))]
12677pub struct GIMBAL_MANAGER_INFORMATION_DATA {
12678 #[doc = "Timestamp (time since system boot)."]
12679 pub time_boot_ms: u32,
12680 #[doc = "Bitmap of gimbal capability flags."]
12681 pub cap_flags: GimbalManagerCapFlags,
12682 #[doc = "Minimum hardware roll angle (positive: rolling to the right, negative: rolling to the left)"]
12683 pub roll_min: f32,
12684 #[doc = "Maximum hardware roll angle (positive: rolling to the right, negative: rolling to the left)"]
12685 pub roll_max: f32,
12686 #[doc = "Minimum pitch angle (positive: up, negative: down)"]
12687 pub pitch_min: f32,
12688 #[doc = "Maximum pitch angle (positive: up, negative: down)"]
12689 pub pitch_max: f32,
12690 #[doc = "Minimum yaw angle (positive: to the right, negative: to the left)"]
12691 pub yaw_min: f32,
12692 #[doc = "Maximum yaw angle (positive: to the right, negative: to the left)"]
12693 pub yaw_max: f32,
12694 #[doc = "Gimbal device ID that this gimbal manager is responsible for. Component ID of gimbal device (or 1-6 for non-MAVLink gimbal)."]
12695 pub gimbal_device_id: u8,
12696}
12697impl GIMBAL_MANAGER_INFORMATION_DATA {
12698 pub const ENCODED_LEN: usize = 33usize;
12699 pub const DEFAULT: Self = Self {
12700 time_boot_ms: 0_u32,
12701 cap_flags: GimbalManagerCapFlags::DEFAULT,
12702 roll_min: 0.0_f32,
12703 roll_max: 0.0_f32,
12704 pitch_min: 0.0_f32,
12705 pitch_max: 0.0_f32,
12706 yaw_min: 0.0_f32,
12707 yaw_max: 0.0_f32,
12708 gimbal_device_id: 0_u8,
12709 };
12710 #[cfg(feature = "arbitrary")]
12711 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
12712 use arbitrary::{Arbitrary, Unstructured};
12713 let mut buf = [0u8; 1024];
12714 rng.fill_bytes(&mut buf);
12715 let mut unstructured = Unstructured::new(&buf);
12716 Self::arbitrary(&mut unstructured).unwrap_or_default()
12717 }
12718}
12719impl Default for GIMBAL_MANAGER_INFORMATION_DATA {
12720 fn default() -> Self {
12721 Self::DEFAULT.clone()
12722 }
12723}
12724impl MessageData for GIMBAL_MANAGER_INFORMATION_DATA {
12725 type Message = MavMessage;
12726 const ID: u32 = 280u32;
12727 const NAME: &'static str = "GIMBAL_MANAGER_INFORMATION";
12728 const EXTRA_CRC: u8 = 70u8;
12729 const ENCODED_LEN: usize = 33usize;
12730 fn deser(
12731 _version: MavlinkVersion,
12732 __input: &[u8],
12733 ) -> Result<Self, ::mavlink_core::error::ParserError> {
12734 let avail_len = __input.len();
12735 let mut payload_buf = [0; Self::ENCODED_LEN];
12736 let mut buf = if avail_len < Self::ENCODED_LEN {
12737 payload_buf[0..avail_len].copy_from_slice(__input);
12738 Bytes::new(&payload_buf)
12739 } else {
12740 Bytes::new(__input)
12741 };
12742 let mut __struct = Self::default();
12743 __struct.time_boot_ms = buf.get_u32_le();
12744 let tmp = buf.get_u32_le();
12745 __struct.cap_flags = GimbalManagerCapFlags::from_bits(
12746 tmp as <GimbalManagerCapFlags as Flags>::Bits,
12747 )
12748 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
12749 flag_type: "GimbalManagerCapFlags",
12750 value: tmp as u64,
12751 })?;
12752 __struct.roll_min = buf.get_f32_le();
12753 __struct.roll_max = buf.get_f32_le();
12754 __struct.pitch_min = buf.get_f32_le();
12755 __struct.pitch_max = buf.get_f32_le();
12756 __struct.yaw_min = buf.get_f32_le();
12757 __struct.yaw_max = buf.get_f32_le();
12758 __struct.gimbal_device_id = buf.get_u8();
12759 Ok(__struct)
12760 }
12761 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
12762 let mut __tmp = BytesMut::new(bytes);
12763 #[allow(clippy::absurd_extreme_comparisons)]
12764 #[allow(unused_comparisons)]
12765 if __tmp.remaining() < Self::ENCODED_LEN {
12766 panic!(
12767 "buffer is too small (need {} bytes, but got {})",
12768 Self::ENCODED_LEN,
12769 __tmp.remaining(),
12770 )
12771 }
12772 __tmp.put_u32_le(self.time_boot_ms);
12773 __tmp.put_u32_le(self.cap_flags.bits() as u32);
12774 __tmp.put_f32_le(self.roll_min);
12775 __tmp.put_f32_le(self.roll_max);
12776 __tmp.put_f32_le(self.pitch_min);
12777 __tmp.put_f32_le(self.pitch_max);
12778 __tmp.put_f32_le(self.yaw_min);
12779 __tmp.put_f32_le(self.yaw_max);
12780 __tmp.put_u8(self.gimbal_device_id);
12781 if matches!(version, MavlinkVersion::V2) {
12782 let len = __tmp.len();
12783 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
12784 } else {
12785 __tmp.len()
12786 }
12787 }
12788}
12789#[doc = "High level message to control a gimbal's attitude. This message is to be sent to the gimbal manager (e.g. from a ground station). Angles and rates can be set to NaN according to use case."]
12790#[doc = ""]
12791#[doc = "ID: 282"]
12792#[derive(Debug, Clone, PartialEq)]
12793#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
12794#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
12795#[cfg_attr(feature = "ts", derive(TS))]
12796#[cfg_attr(feature = "ts", ts(export))]
12797pub struct GIMBAL_MANAGER_SET_ATTITUDE_DATA {
12798 #[doc = "High level gimbal manager flags to use."]
12799 pub flags: GimbalManagerFlags,
12800 #[doc = "Quaternion components, w, x, y, z (1 0 0 0 is the null-rotation, the frame is depends on whether the flag GIMBAL_MANAGER_FLAGS_YAW_LOCK is set)"]
12801 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
12802 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
12803 pub q: [f32; 4],
12804 #[doc = "X component of angular velocity, positive is rolling to the right, NaN to be ignored."]
12805 pub angular_velocity_x: f32,
12806 #[doc = "Y component of angular velocity, positive is pitching up, NaN to be ignored."]
12807 pub angular_velocity_y: f32,
12808 #[doc = "Z component of angular velocity, positive is yawing to the right, NaN to be ignored."]
12809 pub angular_velocity_z: f32,
12810 #[doc = "System ID"]
12811 pub target_system: u8,
12812 #[doc = "Component ID"]
12813 pub target_component: u8,
12814 #[doc = "Component ID of gimbal device to address (or 1-6 for non-MAVLink gimbal), 0 for all gimbal device components. Send command multiple times for more than one gimbal (but not all gimbals)."]
12815 pub gimbal_device_id: u8,
12816}
12817impl GIMBAL_MANAGER_SET_ATTITUDE_DATA {
12818 pub const ENCODED_LEN: usize = 35usize;
12819 pub const DEFAULT: Self = Self {
12820 flags: GimbalManagerFlags::DEFAULT,
12821 q: [0.0_f32; 4usize],
12822 angular_velocity_x: 0.0_f32,
12823 angular_velocity_y: 0.0_f32,
12824 angular_velocity_z: 0.0_f32,
12825 target_system: 0_u8,
12826 target_component: 0_u8,
12827 gimbal_device_id: 0_u8,
12828 };
12829 #[cfg(feature = "arbitrary")]
12830 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
12831 use arbitrary::{Arbitrary, Unstructured};
12832 let mut buf = [0u8; 1024];
12833 rng.fill_bytes(&mut buf);
12834 let mut unstructured = Unstructured::new(&buf);
12835 Self::arbitrary(&mut unstructured).unwrap_or_default()
12836 }
12837}
12838impl Default for GIMBAL_MANAGER_SET_ATTITUDE_DATA {
12839 fn default() -> Self {
12840 Self::DEFAULT.clone()
12841 }
12842}
12843impl MessageData for GIMBAL_MANAGER_SET_ATTITUDE_DATA {
12844 type Message = MavMessage;
12845 const ID: u32 = 282u32;
12846 const NAME: &'static str = "GIMBAL_MANAGER_SET_ATTITUDE";
12847 const EXTRA_CRC: u8 = 123u8;
12848 const ENCODED_LEN: usize = 35usize;
12849 fn deser(
12850 _version: MavlinkVersion,
12851 __input: &[u8],
12852 ) -> Result<Self, ::mavlink_core::error::ParserError> {
12853 let avail_len = __input.len();
12854 let mut payload_buf = [0; Self::ENCODED_LEN];
12855 let mut buf = if avail_len < Self::ENCODED_LEN {
12856 payload_buf[0..avail_len].copy_from_slice(__input);
12857 Bytes::new(&payload_buf)
12858 } else {
12859 Bytes::new(__input)
12860 };
12861 let mut __struct = Self::default();
12862 let tmp = buf.get_u32_le();
12863 __struct.flags = GimbalManagerFlags::from_bits(tmp as <GimbalManagerFlags as Flags>::Bits)
12864 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
12865 flag_type: "GimbalManagerFlags",
12866 value: tmp as u64,
12867 })?;
12868 for v in &mut __struct.q {
12869 let val = buf.get_f32_le();
12870 *v = val;
12871 }
12872 __struct.angular_velocity_x = buf.get_f32_le();
12873 __struct.angular_velocity_y = buf.get_f32_le();
12874 __struct.angular_velocity_z = buf.get_f32_le();
12875 __struct.target_system = buf.get_u8();
12876 __struct.target_component = buf.get_u8();
12877 __struct.gimbal_device_id = buf.get_u8();
12878 Ok(__struct)
12879 }
12880 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
12881 let mut __tmp = BytesMut::new(bytes);
12882 #[allow(clippy::absurd_extreme_comparisons)]
12883 #[allow(unused_comparisons)]
12884 if __tmp.remaining() < Self::ENCODED_LEN {
12885 panic!(
12886 "buffer is too small (need {} bytes, but got {})",
12887 Self::ENCODED_LEN,
12888 __tmp.remaining(),
12889 )
12890 }
12891 __tmp.put_u32_le(self.flags.bits() as u32);
12892 for val in &self.q {
12893 __tmp.put_f32_le(*val);
12894 }
12895 __tmp.put_f32_le(self.angular_velocity_x);
12896 __tmp.put_f32_le(self.angular_velocity_y);
12897 __tmp.put_f32_le(self.angular_velocity_z);
12898 __tmp.put_u8(self.target_system);
12899 __tmp.put_u8(self.target_component);
12900 __tmp.put_u8(self.gimbal_device_id);
12901 if matches!(version, MavlinkVersion::V2) {
12902 let len = __tmp.len();
12903 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
12904 } else {
12905 __tmp.len()
12906 }
12907 }
12908}
12909#[doc = "High level message to control a gimbal manually. The angles or angular rates are unitless; the actual rates will depend on internal gimbal manager settings/configuration (e.g. set by parameters). This message is to be sent to the gimbal manager (e.g. from a ground station). Angles and rates can be set to NaN according to use case."]
12910#[doc = ""]
12911#[doc = "ID: 288"]
12912#[derive(Debug, Clone, PartialEq)]
12913#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
12914#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
12915#[cfg_attr(feature = "ts", derive(TS))]
12916#[cfg_attr(feature = "ts", ts(export))]
12917pub struct GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA {
12918 #[doc = "High level gimbal manager flags."]
12919 pub flags: GimbalManagerFlags,
12920 #[doc = "Pitch angle unitless (-1..1, positive: up, negative: down, NaN to be ignored)."]
12921 pub pitch: f32,
12922 #[doc = "Yaw angle unitless (-1..1, positive: to the right, negative: to the left, NaN to be ignored)."]
12923 pub yaw: f32,
12924 #[doc = "Pitch angular rate unitless (-1..1, positive: up, negative: down, NaN to be ignored)."]
12925 pub pitch_rate: f32,
12926 #[doc = "Yaw angular rate unitless (-1..1, positive: to the right, negative: to the left, NaN to be ignored)."]
12927 pub yaw_rate: f32,
12928 #[doc = "System ID"]
12929 pub target_system: u8,
12930 #[doc = "Component ID"]
12931 pub target_component: u8,
12932 #[doc = "Component ID of gimbal device to address (or 1-6 for non-MAVLink gimbal), 0 for all gimbal device components. Send command multiple times for more than one gimbal (but not all gimbals)."]
12933 pub gimbal_device_id: u8,
12934}
12935impl GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA {
12936 pub const ENCODED_LEN: usize = 23usize;
12937 pub const DEFAULT: Self = Self {
12938 flags: GimbalManagerFlags::DEFAULT,
12939 pitch: 0.0_f32,
12940 yaw: 0.0_f32,
12941 pitch_rate: 0.0_f32,
12942 yaw_rate: 0.0_f32,
12943 target_system: 0_u8,
12944 target_component: 0_u8,
12945 gimbal_device_id: 0_u8,
12946 };
12947 #[cfg(feature = "arbitrary")]
12948 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
12949 use arbitrary::{Arbitrary, Unstructured};
12950 let mut buf = [0u8; 1024];
12951 rng.fill_bytes(&mut buf);
12952 let mut unstructured = Unstructured::new(&buf);
12953 Self::arbitrary(&mut unstructured).unwrap_or_default()
12954 }
12955}
12956impl Default for GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA {
12957 fn default() -> Self {
12958 Self::DEFAULT.clone()
12959 }
12960}
12961impl MessageData for GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA {
12962 type Message = MavMessage;
12963 const ID: u32 = 288u32;
12964 const NAME: &'static str = "GIMBAL_MANAGER_SET_MANUAL_CONTROL";
12965 const EXTRA_CRC: u8 = 20u8;
12966 const ENCODED_LEN: usize = 23usize;
12967 fn deser(
12968 _version: MavlinkVersion,
12969 __input: &[u8],
12970 ) -> Result<Self, ::mavlink_core::error::ParserError> {
12971 let avail_len = __input.len();
12972 let mut payload_buf = [0; Self::ENCODED_LEN];
12973 let mut buf = if avail_len < Self::ENCODED_LEN {
12974 payload_buf[0..avail_len].copy_from_slice(__input);
12975 Bytes::new(&payload_buf)
12976 } else {
12977 Bytes::new(__input)
12978 };
12979 let mut __struct = Self::default();
12980 let tmp = buf.get_u32_le();
12981 __struct.flags = GimbalManagerFlags::from_bits(tmp as <GimbalManagerFlags as Flags>::Bits)
12982 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
12983 flag_type: "GimbalManagerFlags",
12984 value: tmp as u64,
12985 })?;
12986 __struct.pitch = buf.get_f32_le();
12987 __struct.yaw = buf.get_f32_le();
12988 __struct.pitch_rate = buf.get_f32_le();
12989 __struct.yaw_rate = buf.get_f32_le();
12990 __struct.target_system = buf.get_u8();
12991 __struct.target_component = buf.get_u8();
12992 __struct.gimbal_device_id = buf.get_u8();
12993 Ok(__struct)
12994 }
12995 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
12996 let mut __tmp = BytesMut::new(bytes);
12997 #[allow(clippy::absurd_extreme_comparisons)]
12998 #[allow(unused_comparisons)]
12999 if __tmp.remaining() < Self::ENCODED_LEN {
13000 panic!(
13001 "buffer is too small (need {} bytes, but got {})",
13002 Self::ENCODED_LEN,
13003 __tmp.remaining(),
13004 )
13005 }
13006 __tmp.put_u32_le(self.flags.bits() as u32);
13007 __tmp.put_f32_le(self.pitch);
13008 __tmp.put_f32_le(self.yaw);
13009 __tmp.put_f32_le(self.pitch_rate);
13010 __tmp.put_f32_le(self.yaw_rate);
13011 __tmp.put_u8(self.target_system);
13012 __tmp.put_u8(self.target_component);
13013 __tmp.put_u8(self.gimbal_device_id);
13014 if matches!(version, MavlinkVersion::V2) {
13015 let len = __tmp.len();
13016 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
13017 } else {
13018 __tmp.len()
13019 }
13020 }
13021}
13022#[doc = "Set gimbal manager pitch and yaw angles (high rate message). This message is to be sent to the gimbal manager (e.g. from a ground station) and will be ignored by gimbal devices. Angles and rates can be set to NaN according to use case. Use MAV_CMD_DO_GIMBAL_MANAGER_PITCHYAW for low-rate adjustments that require confirmation."]
13023#[doc = ""]
13024#[doc = "ID: 287"]
13025#[derive(Debug, Clone, PartialEq)]
13026#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
13027#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
13028#[cfg_attr(feature = "ts", derive(TS))]
13029#[cfg_attr(feature = "ts", ts(export))]
13030pub struct GIMBAL_MANAGER_SET_PITCHYAW_DATA {
13031 #[doc = "High level gimbal manager flags to use."]
13032 pub flags: GimbalManagerFlags,
13033 #[doc = "Pitch angle (positive: up, negative: down, NaN to be ignored)."]
13034 pub pitch: f32,
13035 #[doc = "Yaw angle (positive: to the right, negative: to the left, NaN to be ignored)."]
13036 pub yaw: f32,
13037 #[doc = "Pitch angular rate (positive: up, negative: down, NaN to be ignored)."]
13038 pub pitch_rate: f32,
13039 #[doc = "Yaw angular rate (positive: to the right, negative: to the left, NaN to be ignored)."]
13040 pub yaw_rate: f32,
13041 #[doc = "System ID"]
13042 pub target_system: u8,
13043 #[doc = "Component ID"]
13044 pub target_component: u8,
13045 #[doc = "Component ID of gimbal device to address (or 1-6 for non-MAVLink gimbal), 0 for all gimbal device components. Send command multiple times for more than one gimbal (but not all gimbals)."]
13046 pub gimbal_device_id: u8,
13047}
13048impl GIMBAL_MANAGER_SET_PITCHYAW_DATA {
13049 pub const ENCODED_LEN: usize = 23usize;
13050 pub const DEFAULT: Self = Self {
13051 flags: GimbalManagerFlags::DEFAULT,
13052 pitch: 0.0_f32,
13053 yaw: 0.0_f32,
13054 pitch_rate: 0.0_f32,
13055 yaw_rate: 0.0_f32,
13056 target_system: 0_u8,
13057 target_component: 0_u8,
13058 gimbal_device_id: 0_u8,
13059 };
13060 #[cfg(feature = "arbitrary")]
13061 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
13062 use arbitrary::{Arbitrary, Unstructured};
13063 let mut buf = [0u8; 1024];
13064 rng.fill_bytes(&mut buf);
13065 let mut unstructured = Unstructured::new(&buf);
13066 Self::arbitrary(&mut unstructured).unwrap_or_default()
13067 }
13068}
13069impl Default for GIMBAL_MANAGER_SET_PITCHYAW_DATA {
13070 fn default() -> Self {
13071 Self::DEFAULT.clone()
13072 }
13073}
13074impl MessageData for GIMBAL_MANAGER_SET_PITCHYAW_DATA {
13075 type Message = MavMessage;
13076 const ID: u32 = 287u32;
13077 const NAME: &'static str = "GIMBAL_MANAGER_SET_PITCHYAW";
13078 const EXTRA_CRC: u8 = 1u8;
13079 const ENCODED_LEN: usize = 23usize;
13080 fn deser(
13081 _version: MavlinkVersion,
13082 __input: &[u8],
13083 ) -> Result<Self, ::mavlink_core::error::ParserError> {
13084 let avail_len = __input.len();
13085 let mut payload_buf = [0; Self::ENCODED_LEN];
13086 let mut buf = if avail_len < Self::ENCODED_LEN {
13087 payload_buf[0..avail_len].copy_from_slice(__input);
13088 Bytes::new(&payload_buf)
13089 } else {
13090 Bytes::new(__input)
13091 };
13092 let mut __struct = Self::default();
13093 let tmp = buf.get_u32_le();
13094 __struct.flags = GimbalManagerFlags::from_bits(tmp as <GimbalManagerFlags as Flags>::Bits)
13095 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
13096 flag_type: "GimbalManagerFlags",
13097 value: tmp as u64,
13098 })?;
13099 __struct.pitch = buf.get_f32_le();
13100 __struct.yaw = buf.get_f32_le();
13101 __struct.pitch_rate = buf.get_f32_le();
13102 __struct.yaw_rate = buf.get_f32_le();
13103 __struct.target_system = buf.get_u8();
13104 __struct.target_component = buf.get_u8();
13105 __struct.gimbal_device_id = buf.get_u8();
13106 Ok(__struct)
13107 }
13108 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
13109 let mut __tmp = BytesMut::new(bytes);
13110 #[allow(clippy::absurd_extreme_comparisons)]
13111 #[allow(unused_comparisons)]
13112 if __tmp.remaining() < Self::ENCODED_LEN {
13113 panic!(
13114 "buffer is too small (need {} bytes, but got {})",
13115 Self::ENCODED_LEN,
13116 __tmp.remaining(),
13117 )
13118 }
13119 __tmp.put_u32_le(self.flags.bits() as u32);
13120 __tmp.put_f32_le(self.pitch);
13121 __tmp.put_f32_le(self.yaw);
13122 __tmp.put_f32_le(self.pitch_rate);
13123 __tmp.put_f32_le(self.yaw_rate);
13124 __tmp.put_u8(self.target_system);
13125 __tmp.put_u8(self.target_component);
13126 __tmp.put_u8(self.gimbal_device_id);
13127 if matches!(version, MavlinkVersion::V2) {
13128 let len = __tmp.len();
13129 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
13130 } else {
13131 __tmp.len()
13132 }
13133 }
13134}
13135#[doc = "Current status about a high level gimbal manager. This message should be broadcast at a low regular rate (e.g. 5Hz)."]
13136#[doc = ""]
13137#[doc = "ID: 281"]
13138#[derive(Debug, Clone, PartialEq)]
13139#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
13140#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
13141#[cfg_attr(feature = "ts", derive(TS))]
13142#[cfg_attr(feature = "ts", ts(export))]
13143pub struct GIMBAL_MANAGER_STATUS_DATA {
13144 #[doc = "Timestamp (time since system boot)."]
13145 pub time_boot_ms: u32,
13146 #[doc = "High level gimbal manager flags currently applied."]
13147 pub flags: GimbalManagerFlags,
13148 #[doc = "Gimbal device ID that this gimbal manager is responsible for. Component ID of gimbal device (or 1-6 for non-MAVLink gimbal)."]
13149 pub gimbal_device_id: u8,
13150 #[doc = "System ID of MAVLink component with primary control, 0 for none."]
13151 pub primary_control_sysid: u8,
13152 #[doc = "Component ID of MAVLink component with primary control, 0 for none."]
13153 pub primary_control_compid: u8,
13154 #[doc = "System ID of MAVLink component with secondary control, 0 for none."]
13155 pub secondary_control_sysid: u8,
13156 #[doc = "Component ID of MAVLink component with secondary control, 0 for none."]
13157 pub secondary_control_compid: u8,
13158}
13159impl GIMBAL_MANAGER_STATUS_DATA {
13160 pub const ENCODED_LEN: usize = 13usize;
13161 pub const DEFAULT: Self = Self {
13162 time_boot_ms: 0_u32,
13163 flags: GimbalManagerFlags::DEFAULT,
13164 gimbal_device_id: 0_u8,
13165 primary_control_sysid: 0_u8,
13166 primary_control_compid: 0_u8,
13167 secondary_control_sysid: 0_u8,
13168 secondary_control_compid: 0_u8,
13169 };
13170 #[cfg(feature = "arbitrary")]
13171 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
13172 use arbitrary::{Arbitrary, Unstructured};
13173 let mut buf = [0u8; 1024];
13174 rng.fill_bytes(&mut buf);
13175 let mut unstructured = Unstructured::new(&buf);
13176 Self::arbitrary(&mut unstructured).unwrap_or_default()
13177 }
13178}
13179impl Default for GIMBAL_MANAGER_STATUS_DATA {
13180 fn default() -> Self {
13181 Self::DEFAULT.clone()
13182 }
13183}
13184impl MessageData for GIMBAL_MANAGER_STATUS_DATA {
13185 type Message = MavMessage;
13186 const ID: u32 = 281u32;
13187 const NAME: &'static str = "GIMBAL_MANAGER_STATUS";
13188 const EXTRA_CRC: u8 = 48u8;
13189 const ENCODED_LEN: usize = 13usize;
13190 fn deser(
13191 _version: MavlinkVersion,
13192 __input: &[u8],
13193 ) -> Result<Self, ::mavlink_core::error::ParserError> {
13194 let avail_len = __input.len();
13195 let mut payload_buf = [0; Self::ENCODED_LEN];
13196 let mut buf = if avail_len < Self::ENCODED_LEN {
13197 payload_buf[0..avail_len].copy_from_slice(__input);
13198 Bytes::new(&payload_buf)
13199 } else {
13200 Bytes::new(__input)
13201 };
13202 let mut __struct = Self::default();
13203 __struct.time_boot_ms = buf.get_u32_le();
13204 let tmp = buf.get_u32_le();
13205 __struct.flags = GimbalManagerFlags::from_bits(tmp as <GimbalManagerFlags as Flags>::Bits)
13206 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
13207 flag_type: "GimbalManagerFlags",
13208 value: tmp as u64,
13209 })?;
13210 __struct.gimbal_device_id = buf.get_u8();
13211 __struct.primary_control_sysid = buf.get_u8();
13212 __struct.primary_control_compid = buf.get_u8();
13213 __struct.secondary_control_sysid = buf.get_u8();
13214 __struct.secondary_control_compid = buf.get_u8();
13215 Ok(__struct)
13216 }
13217 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
13218 let mut __tmp = BytesMut::new(bytes);
13219 #[allow(clippy::absurd_extreme_comparisons)]
13220 #[allow(unused_comparisons)]
13221 if __tmp.remaining() < Self::ENCODED_LEN {
13222 panic!(
13223 "buffer is too small (need {} bytes, but got {})",
13224 Self::ENCODED_LEN,
13225 __tmp.remaining(),
13226 )
13227 }
13228 __tmp.put_u32_le(self.time_boot_ms);
13229 __tmp.put_u32_le(self.flags.bits() as u32);
13230 __tmp.put_u8(self.gimbal_device_id);
13231 __tmp.put_u8(self.primary_control_sysid);
13232 __tmp.put_u8(self.primary_control_compid);
13233 __tmp.put_u8(self.secondary_control_sysid);
13234 __tmp.put_u8(self.secondary_control_compid);
13235 if matches!(version, MavlinkVersion::V2) {
13236 let len = __tmp.len();
13237 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
13238 } else {
13239 __tmp.len()
13240 }
13241 }
13242}
13243#[doc = "The filtered global position (e.g. fused GPS and accelerometers). The position is in GPS-frame (right-handed, Z-up). It is designed as scaled integer message since the resolution of float is not sufficient."]
13244#[doc = ""]
13245#[doc = "ID: 33"]
13246#[derive(Debug, Clone, PartialEq)]
13247#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
13248#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
13249#[cfg_attr(feature = "ts", derive(TS))]
13250#[cfg_attr(feature = "ts", ts(export))]
13251pub struct GLOBAL_POSITION_INT_DATA {
13252 #[doc = "Timestamp (time since system boot)."]
13253 pub time_boot_ms: u32,
13254 #[doc = "Latitude, expressed"]
13255 pub lat: i32,
13256 #[doc = "Longitude, expressed"]
13257 pub lon: i32,
13258 #[doc = "Altitude (MSL). Note that virtually all GPS modules provide both WGS84 and MSL."]
13259 pub alt: i32,
13260 #[doc = "Altitude above home"]
13261 pub relative_alt: i32,
13262 #[doc = "Ground X Speed (Latitude, positive north)"]
13263 pub vx: i16,
13264 #[doc = "Ground Y Speed (Longitude, positive east)"]
13265 pub vy: i16,
13266 #[doc = "Ground Z Speed (Altitude, positive down)"]
13267 pub vz: i16,
13268 #[doc = "Vehicle heading (yaw angle), 0.0..359.99 degrees. If unknown, set to: UINT16_MAX"]
13269 pub hdg: u16,
13270}
13271impl GLOBAL_POSITION_INT_DATA {
13272 pub const ENCODED_LEN: usize = 28usize;
13273 pub const DEFAULT: Self = Self {
13274 time_boot_ms: 0_u32,
13275 lat: 0_i32,
13276 lon: 0_i32,
13277 alt: 0_i32,
13278 relative_alt: 0_i32,
13279 vx: 0_i16,
13280 vy: 0_i16,
13281 vz: 0_i16,
13282 hdg: 0_u16,
13283 };
13284 #[cfg(feature = "arbitrary")]
13285 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
13286 use arbitrary::{Arbitrary, Unstructured};
13287 let mut buf = [0u8; 1024];
13288 rng.fill_bytes(&mut buf);
13289 let mut unstructured = Unstructured::new(&buf);
13290 Self::arbitrary(&mut unstructured).unwrap_or_default()
13291 }
13292}
13293impl Default for GLOBAL_POSITION_INT_DATA {
13294 fn default() -> Self {
13295 Self::DEFAULT.clone()
13296 }
13297}
13298impl MessageData for GLOBAL_POSITION_INT_DATA {
13299 type Message = MavMessage;
13300 const ID: u32 = 33u32;
13301 const NAME: &'static str = "GLOBAL_POSITION_INT";
13302 const EXTRA_CRC: u8 = 104u8;
13303 const ENCODED_LEN: usize = 28usize;
13304 fn deser(
13305 _version: MavlinkVersion,
13306 __input: &[u8],
13307 ) -> Result<Self, ::mavlink_core::error::ParserError> {
13308 let avail_len = __input.len();
13309 let mut payload_buf = [0; Self::ENCODED_LEN];
13310 let mut buf = if avail_len < Self::ENCODED_LEN {
13311 payload_buf[0..avail_len].copy_from_slice(__input);
13312 Bytes::new(&payload_buf)
13313 } else {
13314 Bytes::new(__input)
13315 };
13316 let mut __struct = Self::default();
13317 __struct.time_boot_ms = buf.get_u32_le();
13318 __struct.lat = buf.get_i32_le();
13319 __struct.lon = buf.get_i32_le();
13320 __struct.alt = buf.get_i32_le();
13321 __struct.relative_alt = buf.get_i32_le();
13322 __struct.vx = buf.get_i16_le();
13323 __struct.vy = buf.get_i16_le();
13324 __struct.vz = buf.get_i16_le();
13325 __struct.hdg = buf.get_u16_le();
13326 Ok(__struct)
13327 }
13328 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
13329 let mut __tmp = BytesMut::new(bytes);
13330 #[allow(clippy::absurd_extreme_comparisons)]
13331 #[allow(unused_comparisons)]
13332 if __tmp.remaining() < Self::ENCODED_LEN {
13333 panic!(
13334 "buffer is too small (need {} bytes, but got {})",
13335 Self::ENCODED_LEN,
13336 __tmp.remaining(),
13337 )
13338 }
13339 __tmp.put_u32_le(self.time_boot_ms);
13340 __tmp.put_i32_le(self.lat);
13341 __tmp.put_i32_le(self.lon);
13342 __tmp.put_i32_le(self.alt);
13343 __tmp.put_i32_le(self.relative_alt);
13344 __tmp.put_i16_le(self.vx);
13345 __tmp.put_i16_le(self.vy);
13346 __tmp.put_i16_le(self.vz);
13347 __tmp.put_u16_le(self.hdg);
13348 if matches!(version, MavlinkVersion::V2) {
13349 let len = __tmp.len();
13350 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
13351 } else {
13352 __tmp.len()
13353 }
13354 }
13355}
13356#[doc = "The filtered global position (e.g. fused GPS and accelerometers). The position is in GPS-frame (right-handed, Z-up). It is designed as scaled integer message since the resolution of float is not sufficient. NOTE: This message is intended for onboard networks / companion computers and higher-bandwidth links and optimized for accuracy and completeness. Please use the GLOBAL_POSITION_INT message for a minimal subset."]
13357#[doc = ""]
13358#[doc = "ID: 63"]
13359#[derive(Debug, Clone, PartialEq)]
13360#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
13361#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
13362#[cfg_attr(feature = "ts", derive(TS))]
13363#[cfg_attr(feature = "ts", ts(export))]
13364pub struct GLOBAL_POSITION_INT_COV_DATA {
13365 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
13366 pub time_usec: u64,
13367 #[doc = "Latitude"]
13368 pub lat: i32,
13369 #[doc = "Longitude"]
13370 pub lon: i32,
13371 #[doc = "Altitude in meters above MSL"]
13372 pub alt: i32,
13373 #[doc = "Altitude above ground"]
13374 pub relative_alt: i32,
13375 #[doc = "Ground X Speed (Latitude)"]
13376 pub vx: f32,
13377 #[doc = "Ground Y Speed (Longitude)"]
13378 pub vy: f32,
13379 #[doc = "Ground Z Speed (Altitude)"]
13380 pub vz: f32,
13381 #[doc = "Row-major representation of a 6x6 position and velocity 6x6 cross-covariance matrix (states: lat, lon, alt, vx, vy, vz; first six entries are the first ROW, next six entries are the second row, etc.). If unknown, assign NaN value to first element in the array."]
13382 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
13383 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
13384 pub covariance: [f32; 36],
13385 #[doc = "Class id of the estimator this estimate originated from."]
13386 pub estimator_type: MavEstimatorType,
13387}
13388impl GLOBAL_POSITION_INT_COV_DATA {
13389 pub const ENCODED_LEN: usize = 181usize;
13390 pub const DEFAULT: Self = Self {
13391 time_usec: 0_u64,
13392 lat: 0_i32,
13393 lon: 0_i32,
13394 alt: 0_i32,
13395 relative_alt: 0_i32,
13396 vx: 0.0_f32,
13397 vy: 0.0_f32,
13398 vz: 0.0_f32,
13399 covariance: [0.0_f32; 36usize],
13400 estimator_type: MavEstimatorType::DEFAULT,
13401 };
13402 #[cfg(feature = "arbitrary")]
13403 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
13404 use arbitrary::{Arbitrary, Unstructured};
13405 let mut buf = [0u8; 1024];
13406 rng.fill_bytes(&mut buf);
13407 let mut unstructured = Unstructured::new(&buf);
13408 Self::arbitrary(&mut unstructured).unwrap_or_default()
13409 }
13410}
13411impl Default for GLOBAL_POSITION_INT_COV_DATA {
13412 fn default() -> Self {
13413 Self::DEFAULT.clone()
13414 }
13415}
13416impl MessageData for GLOBAL_POSITION_INT_COV_DATA {
13417 type Message = MavMessage;
13418 const ID: u32 = 63u32;
13419 const NAME: &'static str = "GLOBAL_POSITION_INT_COV";
13420 const EXTRA_CRC: u8 = 119u8;
13421 const ENCODED_LEN: usize = 181usize;
13422 fn deser(
13423 _version: MavlinkVersion,
13424 __input: &[u8],
13425 ) -> Result<Self, ::mavlink_core::error::ParserError> {
13426 let avail_len = __input.len();
13427 let mut payload_buf = [0; Self::ENCODED_LEN];
13428 let mut buf = if avail_len < Self::ENCODED_LEN {
13429 payload_buf[0..avail_len].copy_from_slice(__input);
13430 Bytes::new(&payload_buf)
13431 } else {
13432 Bytes::new(__input)
13433 };
13434 let mut __struct = Self::default();
13435 __struct.time_usec = buf.get_u64_le();
13436 __struct.lat = buf.get_i32_le();
13437 __struct.lon = buf.get_i32_le();
13438 __struct.alt = buf.get_i32_le();
13439 __struct.relative_alt = buf.get_i32_le();
13440 __struct.vx = buf.get_f32_le();
13441 __struct.vy = buf.get_f32_le();
13442 __struct.vz = buf.get_f32_le();
13443 for v in &mut __struct.covariance {
13444 let val = buf.get_f32_le();
13445 *v = val;
13446 }
13447 let tmp = buf.get_u8();
13448 __struct.estimator_type =
13449 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
13450 enum_type: "MavEstimatorType",
13451 value: tmp as u64,
13452 })?;
13453 Ok(__struct)
13454 }
13455 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
13456 let mut __tmp = BytesMut::new(bytes);
13457 #[allow(clippy::absurd_extreme_comparisons)]
13458 #[allow(unused_comparisons)]
13459 if __tmp.remaining() < Self::ENCODED_LEN {
13460 panic!(
13461 "buffer is too small (need {} bytes, but got {})",
13462 Self::ENCODED_LEN,
13463 __tmp.remaining(),
13464 )
13465 }
13466 __tmp.put_u64_le(self.time_usec);
13467 __tmp.put_i32_le(self.lat);
13468 __tmp.put_i32_le(self.lon);
13469 __tmp.put_i32_le(self.alt);
13470 __tmp.put_i32_le(self.relative_alt);
13471 __tmp.put_f32_le(self.vx);
13472 __tmp.put_f32_le(self.vy);
13473 __tmp.put_f32_le(self.vz);
13474 for val in &self.covariance {
13475 __tmp.put_f32_le(*val);
13476 }
13477 __tmp.put_u8(self.estimator_type as u8);
13478 if matches!(version, MavlinkVersion::V2) {
13479 let len = __tmp.len();
13480 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
13481 } else {
13482 __tmp.len()
13483 }
13484 }
13485}
13486#[doc = "Global position/attitude estimate from a vision source."]
13487#[doc = ""]
13488#[doc = "ID: 101"]
13489#[derive(Debug, Clone, PartialEq)]
13490#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
13491#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
13492#[cfg_attr(feature = "ts", derive(TS))]
13493#[cfg_attr(feature = "ts", ts(export))]
13494pub struct GLOBAL_VISION_POSITION_ESTIMATE_DATA {
13495 #[doc = "Timestamp (UNIX time or since system boot)"]
13496 pub usec: u64,
13497 #[doc = "Global X position"]
13498 pub x: f32,
13499 #[doc = "Global Y position"]
13500 pub y: f32,
13501 #[doc = "Global Z position"]
13502 pub z: f32,
13503 #[doc = "Roll angle"]
13504 pub roll: f32,
13505 #[doc = "Pitch angle"]
13506 pub pitch: f32,
13507 #[doc = "Yaw angle"]
13508 pub yaw: f32,
13509 #[doc = "Row-major representation of pose 6x6 cross-covariance matrix upper right triangle (states: x_global, y_global, z_global, roll, pitch, yaw; first six entries are the first ROW, next five entries are the second ROW, etc.). If unknown, assign NaN value to first element in the array."]
13510 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
13511 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
13512 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
13513 pub covariance: [f32; 21],
13514 #[doc = "Estimate reset counter. This should be incremented when the estimate resets in any of the dimensions (position, velocity, attitude, angular speed). This is designed to be used when e.g an external SLAM system detects a loop-closure and the estimate jumps."]
13515 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
13516 pub reset_counter: u8,
13517}
13518impl GLOBAL_VISION_POSITION_ESTIMATE_DATA {
13519 pub const ENCODED_LEN: usize = 117usize;
13520 pub const DEFAULT: Self = Self {
13521 usec: 0_u64,
13522 x: 0.0_f32,
13523 y: 0.0_f32,
13524 z: 0.0_f32,
13525 roll: 0.0_f32,
13526 pitch: 0.0_f32,
13527 yaw: 0.0_f32,
13528 covariance: [0.0_f32; 21usize],
13529 reset_counter: 0_u8,
13530 };
13531 #[cfg(feature = "arbitrary")]
13532 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
13533 use arbitrary::{Arbitrary, Unstructured};
13534 let mut buf = [0u8; 1024];
13535 rng.fill_bytes(&mut buf);
13536 let mut unstructured = Unstructured::new(&buf);
13537 Self::arbitrary(&mut unstructured).unwrap_or_default()
13538 }
13539}
13540impl Default for GLOBAL_VISION_POSITION_ESTIMATE_DATA {
13541 fn default() -> Self {
13542 Self::DEFAULT.clone()
13543 }
13544}
13545impl MessageData for GLOBAL_VISION_POSITION_ESTIMATE_DATA {
13546 type Message = MavMessage;
13547 const ID: u32 = 101u32;
13548 const NAME: &'static str = "GLOBAL_VISION_POSITION_ESTIMATE";
13549 const EXTRA_CRC: u8 = 102u8;
13550 const ENCODED_LEN: usize = 117usize;
13551 fn deser(
13552 _version: MavlinkVersion,
13553 __input: &[u8],
13554 ) -> Result<Self, ::mavlink_core::error::ParserError> {
13555 let avail_len = __input.len();
13556 let mut payload_buf = [0; Self::ENCODED_LEN];
13557 let mut buf = if avail_len < Self::ENCODED_LEN {
13558 payload_buf[0..avail_len].copy_from_slice(__input);
13559 Bytes::new(&payload_buf)
13560 } else {
13561 Bytes::new(__input)
13562 };
13563 let mut __struct = Self::default();
13564 __struct.usec = buf.get_u64_le();
13565 __struct.x = buf.get_f32_le();
13566 __struct.y = buf.get_f32_le();
13567 __struct.z = buf.get_f32_le();
13568 __struct.roll = buf.get_f32_le();
13569 __struct.pitch = buf.get_f32_le();
13570 __struct.yaw = buf.get_f32_le();
13571 for v in &mut __struct.covariance {
13572 let val = buf.get_f32_le();
13573 *v = val;
13574 }
13575 __struct.reset_counter = buf.get_u8();
13576 Ok(__struct)
13577 }
13578 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
13579 let mut __tmp = BytesMut::new(bytes);
13580 #[allow(clippy::absurd_extreme_comparisons)]
13581 #[allow(unused_comparisons)]
13582 if __tmp.remaining() < Self::ENCODED_LEN {
13583 panic!(
13584 "buffer is too small (need {} bytes, but got {})",
13585 Self::ENCODED_LEN,
13586 __tmp.remaining(),
13587 )
13588 }
13589 __tmp.put_u64_le(self.usec);
13590 __tmp.put_f32_le(self.x);
13591 __tmp.put_f32_le(self.y);
13592 __tmp.put_f32_le(self.z);
13593 __tmp.put_f32_le(self.roll);
13594 __tmp.put_f32_le(self.pitch);
13595 __tmp.put_f32_le(self.yaw);
13596 if matches!(version, MavlinkVersion::V2) {
13597 for val in &self.covariance {
13598 __tmp.put_f32_le(*val);
13599 }
13600 __tmp.put_u8(self.reset_counter);
13601 let len = __tmp.len();
13602 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
13603 } else {
13604 __tmp.len()
13605 }
13606 }
13607}
13608#[doc = "Second GPS data."]
13609#[doc = ""]
13610#[doc = "ID: 124"]
13611#[derive(Debug, Clone, PartialEq)]
13612#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
13613#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
13614#[cfg_attr(feature = "ts", derive(TS))]
13615#[cfg_attr(feature = "ts", ts(export))]
13616pub struct GPS2_RAW_DATA {
13617 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
13618 pub time_usec: u64,
13619 #[doc = "Latitude (WGS84)"]
13620 pub lat: i32,
13621 #[doc = "Longitude (WGS84)"]
13622 pub lon: i32,
13623 #[doc = "Altitude (MSL). Positive for up."]
13624 pub alt: i32,
13625 #[doc = "Age of DGPS info"]
13626 pub dgps_age: u32,
13627 #[doc = "GPS HDOP horizontal dilution of position (unitless * 100). If unknown, set to: UINT16_MAX"]
13628 pub eph: u16,
13629 #[doc = "GPS VDOP vertical dilution of position (unitless * 100). If unknown, set to: UINT16_MAX"]
13630 pub epv: u16,
13631 #[doc = "GPS ground speed. If unknown, set to: UINT16_MAX"]
13632 pub vel: u16,
13633 #[doc = "Course over ground (NOT heading, but direction of movement): 0.0..359.99 degrees. If unknown, set to: UINT16_MAX"]
13634 pub cog: u16,
13635 #[doc = "GPS fix type."]
13636 pub fix_type: GpsFixType,
13637 #[doc = "Number of satellites visible. If unknown, set to UINT8_MAX"]
13638 pub satellites_visible: u8,
13639 #[doc = "Number of DGPS satellites"]
13640 pub dgps_numch: u8,
13641 #[doc = "Yaw in earth frame from north. Use 0 if this GPS does not provide yaw. Use UINT16_MAX if this GPS is configured to provide yaw and is currently unable to provide it. Use 36000 for north."]
13642 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
13643 pub yaw: u16,
13644 #[doc = "Altitude (above WGS84, EGM96 ellipsoid). Positive for up."]
13645 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
13646 pub alt_ellipsoid: i32,
13647 #[doc = "Position uncertainty."]
13648 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
13649 pub h_acc: u32,
13650 #[doc = "Altitude uncertainty."]
13651 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
13652 pub v_acc: u32,
13653 #[doc = "Speed uncertainty."]
13654 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
13655 pub vel_acc: u32,
13656 #[doc = "Heading / track uncertainty"]
13657 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
13658 pub hdg_acc: u32,
13659}
13660impl GPS2_RAW_DATA {
13661 pub const ENCODED_LEN: usize = 57usize;
13662 pub const DEFAULT: Self = Self {
13663 time_usec: 0_u64,
13664 lat: 0_i32,
13665 lon: 0_i32,
13666 alt: 0_i32,
13667 dgps_age: 0_u32,
13668 eph: 0_u16,
13669 epv: 0_u16,
13670 vel: 0_u16,
13671 cog: 0_u16,
13672 fix_type: GpsFixType::DEFAULT,
13673 satellites_visible: 0_u8,
13674 dgps_numch: 0_u8,
13675 yaw: 0_u16,
13676 alt_ellipsoid: 0_i32,
13677 h_acc: 0_u32,
13678 v_acc: 0_u32,
13679 vel_acc: 0_u32,
13680 hdg_acc: 0_u32,
13681 };
13682 #[cfg(feature = "arbitrary")]
13683 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
13684 use arbitrary::{Arbitrary, Unstructured};
13685 let mut buf = [0u8; 1024];
13686 rng.fill_bytes(&mut buf);
13687 let mut unstructured = Unstructured::new(&buf);
13688 Self::arbitrary(&mut unstructured).unwrap_or_default()
13689 }
13690}
13691impl Default for GPS2_RAW_DATA {
13692 fn default() -> Self {
13693 Self::DEFAULT.clone()
13694 }
13695}
13696impl MessageData for GPS2_RAW_DATA {
13697 type Message = MavMessage;
13698 const ID: u32 = 124u32;
13699 const NAME: &'static str = "GPS2_RAW";
13700 const EXTRA_CRC: u8 = 87u8;
13701 const ENCODED_LEN: usize = 57usize;
13702 fn deser(
13703 _version: MavlinkVersion,
13704 __input: &[u8],
13705 ) -> Result<Self, ::mavlink_core::error::ParserError> {
13706 let avail_len = __input.len();
13707 let mut payload_buf = [0; Self::ENCODED_LEN];
13708 let mut buf = if avail_len < Self::ENCODED_LEN {
13709 payload_buf[0..avail_len].copy_from_slice(__input);
13710 Bytes::new(&payload_buf)
13711 } else {
13712 Bytes::new(__input)
13713 };
13714 let mut __struct = Self::default();
13715 __struct.time_usec = buf.get_u64_le();
13716 __struct.lat = buf.get_i32_le();
13717 __struct.lon = buf.get_i32_le();
13718 __struct.alt = buf.get_i32_le();
13719 __struct.dgps_age = buf.get_u32_le();
13720 __struct.eph = buf.get_u16_le();
13721 __struct.epv = buf.get_u16_le();
13722 __struct.vel = buf.get_u16_le();
13723 __struct.cog = buf.get_u16_le();
13724 let tmp = buf.get_u8();
13725 __struct.fix_type =
13726 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
13727 enum_type: "GpsFixType",
13728 value: tmp as u64,
13729 })?;
13730 __struct.satellites_visible = buf.get_u8();
13731 __struct.dgps_numch = buf.get_u8();
13732 __struct.yaw = buf.get_u16_le();
13733 __struct.alt_ellipsoid = buf.get_i32_le();
13734 __struct.h_acc = buf.get_u32_le();
13735 __struct.v_acc = buf.get_u32_le();
13736 __struct.vel_acc = buf.get_u32_le();
13737 __struct.hdg_acc = buf.get_u32_le();
13738 Ok(__struct)
13739 }
13740 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
13741 let mut __tmp = BytesMut::new(bytes);
13742 #[allow(clippy::absurd_extreme_comparisons)]
13743 #[allow(unused_comparisons)]
13744 if __tmp.remaining() < Self::ENCODED_LEN {
13745 panic!(
13746 "buffer is too small (need {} bytes, but got {})",
13747 Self::ENCODED_LEN,
13748 __tmp.remaining(),
13749 )
13750 }
13751 __tmp.put_u64_le(self.time_usec);
13752 __tmp.put_i32_le(self.lat);
13753 __tmp.put_i32_le(self.lon);
13754 __tmp.put_i32_le(self.alt);
13755 __tmp.put_u32_le(self.dgps_age);
13756 __tmp.put_u16_le(self.eph);
13757 __tmp.put_u16_le(self.epv);
13758 __tmp.put_u16_le(self.vel);
13759 __tmp.put_u16_le(self.cog);
13760 __tmp.put_u8(self.fix_type as u8);
13761 __tmp.put_u8(self.satellites_visible);
13762 __tmp.put_u8(self.dgps_numch);
13763 if matches!(version, MavlinkVersion::V2) {
13764 __tmp.put_u16_le(self.yaw);
13765 __tmp.put_i32_le(self.alt_ellipsoid);
13766 __tmp.put_u32_le(self.h_acc);
13767 __tmp.put_u32_le(self.v_acc);
13768 __tmp.put_u32_le(self.vel_acc);
13769 __tmp.put_u32_le(self.hdg_acc);
13770 let len = __tmp.len();
13771 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
13772 } else {
13773 __tmp.len()
13774 }
13775 }
13776}
13777#[doc = "RTK GPS data. Gives information on the relative baseline calculation the GPS is reporting."]
13778#[doc = ""]
13779#[doc = "ID: 128"]
13780#[derive(Debug, Clone, PartialEq)]
13781#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
13782#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
13783#[cfg_attr(feature = "ts", derive(TS))]
13784#[cfg_attr(feature = "ts", ts(export))]
13785pub struct GPS2_RTK_DATA {
13786 #[doc = "Time since boot of last baseline message received."]
13787 pub time_last_baseline_ms: u32,
13788 #[doc = "GPS Time of Week of last baseline"]
13789 pub tow: u32,
13790 #[doc = "Current baseline in ECEF x or NED north component."]
13791 pub baseline_a_mm: i32,
13792 #[doc = "Current baseline in ECEF y or NED east component."]
13793 pub baseline_b_mm: i32,
13794 #[doc = "Current baseline in ECEF z or NED down component."]
13795 pub baseline_c_mm: i32,
13796 #[doc = "Current estimate of baseline accuracy."]
13797 pub accuracy: u32,
13798 #[doc = "Current number of integer ambiguity hypotheses."]
13799 pub iar_num_hypotheses: i32,
13800 #[doc = "GPS Week Number of last baseline"]
13801 pub wn: u16,
13802 #[doc = "Identification of connected RTK receiver."]
13803 pub rtk_receiver_id: u8,
13804 #[doc = "GPS-specific health report for RTK data."]
13805 pub rtk_health: u8,
13806 #[doc = "Rate of baseline messages being received by GPS"]
13807 pub rtk_rate: u8,
13808 #[doc = "Current number of sats used for RTK calculation."]
13809 pub nsats: u8,
13810 #[doc = "Coordinate system of baseline"]
13811 pub baseline_coords_type: RtkBaselineCoordinateSystem,
13812}
13813impl GPS2_RTK_DATA {
13814 pub const ENCODED_LEN: usize = 35usize;
13815 pub const DEFAULT: Self = Self {
13816 time_last_baseline_ms: 0_u32,
13817 tow: 0_u32,
13818 baseline_a_mm: 0_i32,
13819 baseline_b_mm: 0_i32,
13820 baseline_c_mm: 0_i32,
13821 accuracy: 0_u32,
13822 iar_num_hypotheses: 0_i32,
13823 wn: 0_u16,
13824 rtk_receiver_id: 0_u8,
13825 rtk_health: 0_u8,
13826 rtk_rate: 0_u8,
13827 nsats: 0_u8,
13828 baseline_coords_type: RtkBaselineCoordinateSystem::DEFAULT,
13829 };
13830 #[cfg(feature = "arbitrary")]
13831 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
13832 use arbitrary::{Arbitrary, Unstructured};
13833 let mut buf = [0u8; 1024];
13834 rng.fill_bytes(&mut buf);
13835 let mut unstructured = Unstructured::new(&buf);
13836 Self::arbitrary(&mut unstructured).unwrap_or_default()
13837 }
13838}
13839impl Default for GPS2_RTK_DATA {
13840 fn default() -> Self {
13841 Self::DEFAULT.clone()
13842 }
13843}
13844impl MessageData for GPS2_RTK_DATA {
13845 type Message = MavMessage;
13846 const ID: u32 = 128u32;
13847 const NAME: &'static str = "GPS2_RTK";
13848 const EXTRA_CRC: u8 = 226u8;
13849 const ENCODED_LEN: usize = 35usize;
13850 fn deser(
13851 _version: MavlinkVersion,
13852 __input: &[u8],
13853 ) -> Result<Self, ::mavlink_core::error::ParserError> {
13854 let avail_len = __input.len();
13855 let mut payload_buf = [0; Self::ENCODED_LEN];
13856 let mut buf = if avail_len < Self::ENCODED_LEN {
13857 payload_buf[0..avail_len].copy_from_slice(__input);
13858 Bytes::new(&payload_buf)
13859 } else {
13860 Bytes::new(__input)
13861 };
13862 let mut __struct = Self::default();
13863 __struct.time_last_baseline_ms = buf.get_u32_le();
13864 __struct.tow = buf.get_u32_le();
13865 __struct.baseline_a_mm = buf.get_i32_le();
13866 __struct.baseline_b_mm = buf.get_i32_le();
13867 __struct.baseline_c_mm = buf.get_i32_le();
13868 __struct.accuracy = buf.get_u32_le();
13869 __struct.iar_num_hypotheses = buf.get_i32_le();
13870 __struct.wn = buf.get_u16_le();
13871 __struct.rtk_receiver_id = buf.get_u8();
13872 __struct.rtk_health = buf.get_u8();
13873 __struct.rtk_rate = buf.get_u8();
13874 __struct.nsats = buf.get_u8();
13875 let tmp = buf.get_u8();
13876 __struct.baseline_coords_type =
13877 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
13878 enum_type: "RtkBaselineCoordinateSystem",
13879 value: tmp as u64,
13880 })?;
13881 Ok(__struct)
13882 }
13883 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
13884 let mut __tmp = BytesMut::new(bytes);
13885 #[allow(clippy::absurd_extreme_comparisons)]
13886 #[allow(unused_comparisons)]
13887 if __tmp.remaining() < Self::ENCODED_LEN {
13888 panic!(
13889 "buffer is too small (need {} bytes, but got {})",
13890 Self::ENCODED_LEN,
13891 __tmp.remaining(),
13892 )
13893 }
13894 __tmp.put_u32_le(self.time_last_baseline_ms);
13895 __tmp.put_u32_le(self.tow);
13896 __tmp.put_i32_le(self.baseline_a_mm);
13897 __tmp.put_i32_le(self.baseline_b_mm);
13898 __tmp.put_i32_le(self.baseline_c_mm);
13899 __tmp.put_u32_le(self.accuracy);
13900 __tmp.put_i32_le(self.iar_num_hypotheses);
13901 __tmp.put_u16_le(self.wn);
13902 __tmp.put_u8(self.rtk_receiver_id);
13903 __tmp.put_u8(self.rtk_health);
13904 __tmp.put_u8(self.rtk_rate);
13905 __tmp.put_u8(self.nsats);
13906 __tmp.put_u8(self.baseline_coords_type as u8);
13907 if matches!(version, MavlinkVersion::V2) {
13908 let len = __tmp.len();
13909 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
13910 } else {
13911 __tmp.len()
13912 }
13913 }
13914}
13915#[doc = "Publishes the GPS coordinates of the vehicle local origin (0,0,0) position. Emitted whenever a new GPS-Local position mapping is requested or set - e.g. following SET_GPS_GLOBAL_ORIGIN message."]
13916#[doc = ""]
13917#[doc = "ID: 49"]
13918#[derive(Debug, Clone, PartialEq)]
13919#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
13920#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
13921#[cfg_attr(feature = "ts", derive(TS))]
13922#[cfg_attr(feature = "ts", ts(export))]
13923pub struct GPS_GLOBAL_ORIGIN_DATA {
13924 #[doc = "Latitude (WGS84)"]
13925 pub latitude: i32,
13926 #[doc = "Longitude (WGS84)"]
13927 pub longitude: i32,
13928 #[doc = "Altitude (MSL). Positive for up."]
13929 pub altitude: i32,
13930 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
13931 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
13932 pub time_usec: u64,
13933}
13934impl GPS_GLOBAL_ORIGIN_DATA {
13935 pub const ENCODED_LEN: usize = 20usize;
13936 pub const DEFAULT: Self = Self {
13937 latitude: 0_i32,
13938 longitude: 0_i32,
13939 altitude: 0_i32,
13940 time_usec: 0_u64,
13941 };
13942 #[cfg(feature = "arbitrary")]
13943 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
13944 use arbitrary::{Arbitrary, Unstructured};
13945 let mut buf = [0u8; 1024];
13946 rng.fill_bytes(&mut buf);
13947 let mut unstructured = Unstructured::new(&buf);
13948 Self::arbitrary(&mut unstructured).unwrap_or_default()
13949 }
13950}
13951impl Default for GPS_GLOBAL_ORIGIN_DATA {
13952 fn default() -> Self {
13953 Self::DEFAULT.clone()
13954 }
13955}
13956impl MessageData for GPS_GLOBAL_ORIGIN_DATA {
13957 type Message = MavMessage;
13958 const ID: u32 = 49u32;
13959 const NAME: &'static str = "GPS_GLOBAL_ORIGIN";
13960 const EXTRA_CRC: u8 = 39u8;
13961 const ENCODED_LEN: usize = 20usize;
13962 fn deser(
13963 _version: MavlinkVersion,
13964 __input: &[u8],
13965 ) -> Result<Self, ::mavlink_core::error::ParserError> {
13966 let avail_len = __input.len();
13967 let mut payload_buf = [0; Self::ENCODED_LEN];
13968 let mut buf = if avail_len < Self::ENCODED_LEN {
13969 payload_buf[0..avail_len].copy_from_slice(__input);
13970 Bytes::new(&payload_buf)
13971 } else {
13972 Bytes::new(__input)
13973 };
13974 let mut __struct = Self::default();
13975 __struct.latitude = buf.get_i32_le();
13976 __struct.longitude = buf.get_i32_le();
13977 __struct.altitude = buf.get_i32_le();
13978 __struct.time_usec = buf.get_u64_le();
13979 Ok(__struct)
13980 }
13981 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
13982 let mut __tmp = BytesMut::new(bytes);
13983 #[allow(clippy::absurd_extreme_comparisons)]
13984 #[allow(unused_comparisons)]
13985 if __tmp.remaining() < Self::ENCODED_LEN {
13986 panic!(
13987 "buffer is too small (need {} bytes, but got {})",
13988 Self::ENCODED_LEN,
13989 __tmp.remaining(),
13990 )
13991 }
13992 __tmp.put_i32_le(self.latitude);
13993 __tmp.put_i32_le(self.longitude);
13994 __tmp.put_i32_le(self.altitude);
13995 if matches!(version, MavlinkVersion::V2) {
13996 __tmp.put_u64_le(self.time_usec);
13997 let len = __tmp.len();
13998 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
13999 } else {
14000 __tmp.len()
14001 }
14002 }
14003}
14004#[deprecated = " See `GPS_RTCM_DATA` (Deprecated since 2022-05)"]
14005#[doc = "Data for injecting into the onboard GPS (used for DGPS)."]
14006#[doc = ""]
14007#[doc = "ID: 123"]
14008#[derive(Debug, Clone, PartialEq)]
14009#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
14010#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
14011#[cfg_attr(feature = "ts", derive(TS))]
14012#[cfg_attr(feature = "ts", ts(export))]
14013pub struct GPS_INJECT_DATA_DATA {
14014 #[doc = "System ID"]
14015 pub target_system: u8,
14016 #[doc = "Component ID"]
14017 pub target_component: u8,
14018 #[doc = "Data length"]
14019 pub len: u8,
14020 #[doc = "Raw data (110 is enough for 12 satellites of RTCMv2)"]
14021 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
14022 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
14023 pub data: [u8; 110],
14024}
14025impl GPS_INJECT_DATA_DATA {
14026 pub const ENCODED_LEN: usize = 113usize;
14027 pub const DEFAULT: Self = Self {
14028 target_system: 0_u8,
14029 target_component: 0_u8,
14030 len: 0_u8,
14031 data: [0_u8; 110usize],
14032 };
14033 #[cfg(feature = "arbitrary")]
14034 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
14035 use arbitrary::{Arbitrary, Unstructured};
14036 let mut buf = [0u8; 1024];
14037 rng.fill_bytes(&mut buf);
14038 let mut unstructured = Unstructured::new(&buf);
14039 Self::arbitrary(&mut unstructured).unwrap_or_default()
14040 }
14041}
14042impl Default for GPS_INJECT_DATA_DATA {
14043 fn default() -> Self {
14044 Self::DEFAULT.clone()
14045 }
14046}
14047impl MessageData for GPS_INJECT_DATA_DATA {
14048 type Message = MavMessage;
14049 const ID: u32 = 123u32;
14050 const NAME: &'static str = "GPS_INJECT_DATA";
14051 const EXTRA_CRC: u8 = 250u8;
14052 const ENCODED_LEN: usize = 113usize;
14053 fn deser(
14054 _version: MavlinkVersion,
14055 __input: &[u8],
14056 ) -> Result<Self, ::mavlink_core::error::ParserError> {
14057 let avail_len = __input.len();
14058 let mut payload_buf = [0; Self::ENCODED_LEN];
14059 let mut buf = if avail_len < Self::ENCODED_LEN {
14060 payload_buf[0..avail_len].copy_from_slice(__input);
14061 Bytes::new(&payload_buf)
14062 } else {
14063 Bytes::new(__input)
14064 };
14065 let mut __struct = Self::default();
14066 __struct.target_system = buf.get_u8();
14067 __struct.target_component = buf.get_u8();
14068 __struct.len = buf.get_u8();
14069 for v in &mut __struct.data {
14070 let val = buf.get_u8();
14071 *v = val;
14072 }
14073 Ok(__struct)
14074 }
14075 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
14076 let mut __tmp = BytesMut::new(bytes);
14077 #[allow(clippy::absurd_extreme_comparisons)]
14078 #[allow(unused_comparisons)]
14079 if __tmp.remaining() < Self::ENCODED_LEN {
14080 panic!(
14081 "buffer is too small (need {} bytes, but got {})",
14082 Self::ENCODED_LEN,
14083 __tmp.remaining(),
14084 )
14085 }
14086 __tmp.put_u8(self.target_system);
14087 __tmp.put_u8(self.target_component);
14088 __tmp.put_u8(self.len);
14089 for val in &self.data {
14090 __tmp.put_u8(*val);
14091 }
14092 if matches!(version, MavlinkVersion::V2) {
14093 let len = __tmp.len();
14094 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
14095 } else {
14096 __tmp.len()
14097 }
14098 }
14099}
14100#[doc = "GPS sensor input message. This is a raw sensor value sent by the GPS. This is NOT the global position estimate of the system."]
14101#[doc = ""]
14102#[doc = "ID: 232"]
14103#[derive(Debug, Clone, PartialEq)]
14104#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
14105#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
14106#[cfg_attr(feature = "ts", derive(TS))]
14107#[cfg_attr(feature = "ts", ts(export))]
14108pub struct GPS_INPUT_DATA {
14109 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
14110 pub time_usec: u64,
14111 #[doc = "GPS time (from start of GPS week)"]
14112 pub time_week_ms: u32,
14113 #[doc = "Latitude (WGS84)"]
14114 pub lat: i32,
14115 #[doc = "Longitude (WGS84)"]
14116 pub lon: i32,
14117 #[doc = "Altitude (MSL). Positive for up."]
14118 pub alt: f32,
14119 #[doc = "GPS HDOP horizontal dilution of position (unitless). If unknown, set to: UINT16_MAX"]
14120 pub hdop: f32,
14121 #[doc = "GPS VDOP vertical dilution of position (unitless). If unknown, set to: UINT16_MAX"]
14122 pub vdop: f32,
14123 #[doc = "GPS velocity in north direction in earth-fixed NED frame"]
14124 pub vn: f32,
14125 #[doc = "GPS velocity in east direction in earth-fixed NED frame"]
14126 pub ve: f32,
14127 #[doc = "GPS velocity in down direction in earth-fixed NED frame"]
14128 pub vd: f32,
14129 #[doc = "GPS speed accuracy"]
14130 pub speed_accuracy: f32,
14131 #[doc = "GPS horizontal accuracy"]
14132 pub horiz_accuracy: f32,
14133 #[doc = "GPS vertical accuracy"]
14134 pub vert_accuracy: f32,
14135 #[doc = "Bitmap indicating which GPS input flags fields to ignore. All other fields must be provided."]
14136 pub ignore_flags: GpsInputIgnoreFlags,
14137 #[doc = "GPS week number"]
14138 pub time_week: u16,
14139 #[doc = "ID of the GPS for multiple GPS inputs"]
14140 pub gps_id: u8,
14141 #[doc = "0-1: no fix, 2: 2D fix, 3: 3D fix. 4: 3D with DGPS. 5: 3D with RTK"]
14142 pub fix_type: u8,
14143 #[doc = "Number of satellites visible."]
14144 pub satellites_visible: u8,
14145 #[doc = "Yaw of vehicle relative to Earth's North, zero means not available, use 36000 for north"]
14146 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
14147 pub yaw: u16,
14148}
14149impl GPS_INPUT_DATA {
14150 pub const ENCODED_LEN: usize = 65usize;
14151 pub const DEFAULT: Self = Self {
14152 time_usec: 0_u64,
14153 time_week_ms: 0_u32,
14154 lat: 0_i32,
14155 lon: 0_i32,
14156 alt: 0.0_f32,
14157 hdop: 0.0_f32,
14158 vdop: 0.0_f32,
14159 vn: 0.0_f32,
14160 ve: 0.0_f32,
14161 vd: 0.0_f32,
14162 speed_accuracy: 0.0_f32,
14163 horiz_accuracy: 0.0_f32,
14164 vert_accuracy: 0.0_f32,
14165 ignore_flags: GpsInputIgnoreFlags::DEFAULT,
14166 time_week: 0_u16,
14167 gps_id: 0_u8,
14168 fix_type: 0_u8,
14169 satellites_visible: 0_u8,
14170 yaw: 0_u16,
14171 };
14172 #[cfg(feature = "arbitrary")]
14173 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
14174 use arbitrary::{Arbitrary, Unstructured};
14175 let mut buf = [0u8; 1024];
14176 rng.fill_bytes(&mut buf);
14177 let mut unstructured = Unstructured::new(&buf);
14178 Self::arbitrary(&mut unstructured).unwrap_or_default()
14179 }
14180}
14181impl Default for GPS_INPUT_DATA {
14182 fn default() -> Self {
14183 Self::DEFAULT.clone()
14184 }
14185}
14186impl MessageData for GPS_INPUT_DATA {
14187 type Message = MavMessage;
14188 const ID: u32 = 232u32;
14189 const NAME: &'static str = "GPS_INPUT";
14190 const EXTRA_CRC: u8 = 151u8;
14191 const ENCODED_LEN: usize = 65usize;
14192 fn deser(
14193 _version: MavlinkVersion,
14194 __input: &[u8],
14195 ) -> Result<Self, ::mavlink_core::error::ParserError> {
14196 let avail_len = __input.len();
14197 let mut payload_buf = [0; Self::ENCODED_LEN];
14198 let mut buf = if avail_len < Self::ENCODED_LEN {
14199 payload_buf[0..avail_len].copy_from_slice(__input);
14200 Bytes::new(&payload_buf)
14201 } else {
14202 Bytes::new(__input)
14203 };
14204 let mut __struct = Self::default();
14205 __struct.time_usec = buf.get_u64_le();
14206 __struct.time_week_ms = buf.get_u32_le();
14207 __struct.lat = buf.get_i32_le();
14208 __struct.lon = buf.get_i32_le();
14209 __struct.alt = buf.get_f32_le();
14210 __struct.hdop = buf.get_f32_le();
14211 __struct.vdop = buf.get_f32_le();
14212 __struct.vn = buf.get_f32_le();
14213 __struct.ve = buf.get_f32_le();
14214 __struct.vd = buf.get_f32_le();
14215 __struct.speed_accuracy = buf.get_f32_le();
14216 __struct.horiz_accuracy = buf.get_f32_le();
14217 __struct.vert_accuracy = buf.get_f32_le();
14218 let tmp = buf.get_u16_le();
14219 __struct.ignore_flags = GpsInputIgnoreFlags::from_bits(
14220 tmp as <GpsInputIgnoreFlags as Flags>::Bits,
14221 )
14222 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
14223 flag_type: "GpsInputIgnoreFlags",
14224 value: tmp as u64,
14225 })?;
14226 __struct.time_week = buf.get_u16_le();
14227 __struct.gps_id = buf.get_u8();
14228 __struct.fix_type = buf.get_u8();
14229 __struct.satellites_visible = buf.get_u8();
14230 __struct.yaw = buf.get_u16_le();
14231 Ok(__struct)
14232 }
14233 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
14234 let mut __tmp = BytesMut::new(bytes);
14235 #[allow(clippy::absurd_extreme_comparisons)]
14236 #[allow(unused_comparisons)]
14237 if __tmp.remaining() < Self::ENCODED_LEN {
14238 panic!(
14239 "buffer is too small (need {} bytes, but got {})",
14240 Self::ENCODED_LEN,
14241 __tmp.remaining(),
14242 )
14243 }
14244 __tmp.put_u64_le(self.time_usec);
14245 __tmp.put_u32_le(self.time_week_ms);
14246 __tmp.put_i32_le(self.lat);
14247 __tmp.put_i32_le(self.lon);
14248 __tmp.put_f32_le(self.alt);
14249 __tmp.put_f32_le(self.hdop);
14250 __tmp.put_f32_le(self.vdop);
14251 __tmp.put_f32_le(self.vn);
14252 __tmp.put_f32_le(self.ve);
14253 __tmp.put_f32_le(self.vd);
14254 __tmp.put_f32_le(self.speed_accuracy);
14255 __tmp.put_f32_le(self.horiz_accuracy);
14256 __tmp.put_f32_le(self.vert_accuracy);
14257 __tmp.put_u16_le(self.ignore_flags.bits() as u16);
14258 __tmp.put_u16_le(self.time_week);
14259 __tmp.put_u8(self.gps_id);
14260 __tmp.put_u8(self.fix_type);
14261 __tmp.put_u8(self.satellites_visible);
14262 if matches!(version, MavlinkVersion::V2) {
14263 __tmp.put_u16_le(self.yaw);
14264 let len = __tmp.len();
14265 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
14266 } else {
14267 __tmp.len()
14268 }
14269 }
14270}
14271#[doc = "The global position, as returned by the Global Positioning System (GPS). This is NOT the global position estimate of the system, but rather a RAW sensor value. See message GLOBAL_POSITION_INT for the global position estimate."]
14272#[doc = ""]
14273#[doc = "ID: 24"]
14274#[derive(Debug, Clone, PartialEq)]
14275#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
14276#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
14277#[cfg_attr(feature = "ts", derive(TS))]
14278#[cfg_attr(feature = "ts", ts(export))]
14279pub struct GPS_RAW_INT_DATA {
14280 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
14281 pub time_usec: u64,
14282 #[doc = "Latitude (WGS84, EGM96 ellipsoid)"]
14283 pub lat: i32,
14284 #[doc = "Longitude (WGS84, EGM96 ellipsoid)"]
14285 pub lon: i32,
14286 #[doc = "Altitude (MSL). Positive for up. Note that virtually all GPS modules provide the MSL altitude in addition to the WGS84 altitude."]
14287 pub alt: i32,
14288 #[doc = "GPS HDOP horizontal dilution of position (unitless * 100). If unknown, set to: UINT16_MAX"]
14289 pub eph: u16,
14290 #[doc = "GPS VDOP vertical dilution of position (unitless * 100). If unknown, set to: UINT16_MAX"]
14291 pub epv: u16,
14292 #[doc = "GPS ground speed. If unknown, set to: UINT16_MAX"]
14293 pub vel: u16,
14294 #[doc = "Course over ground (NOT heading, but direction of movement) in degrees * 100, 0.0..359.99 degrees. If unknown, set to: UINT16_MAX"]
14295 pub cog: u16,
14296 #[doc = "GPS fix type."]
14297 pub fix_type: GpsFixType,
14298 #[doc = "Number of satellites visible. If unknown, set to UINT8_MAX"]
14299 pub satellites_visible: u8,
14300 #[doc = "Altitude (above WGS84, EGM96 ellipsoid). Positive for up."]
14301 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
14302 pub alt_ellipsoid: i32,
14303 #[doc = "Position uncertainty."]
14304 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
14305 pub h_acc: u32,
14306 #[doc = "Altitude uncertainty."]
14307 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
14308 pub v_acc: u32,
14309 #[doc = "Speed uncertainty."]
14310 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
14311 pub vel_acc: u32,
14312 #[doc = "Heading / track uncertainty"]
14313 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
14314 pub hdg_acc: u32,
14315 #[doc = "Yaw in earth frame from north. Use 0 if this GPS does not provide yaw. Use UINT16_MAX if this GPS is configured to provide yaw and is currently unable to provide it. Use 36000 for north."]
14316 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
14317 pub yaw: u16,
14318}
14319impl GPS_RAW_INT_DATA {
14320 pub const ENCODED_LEN: usize = 52usize;
14321 pub const DEFAULT: Self = Self {
14322 time_usec: 0_u64,
14323 lat: 0_i32,
14324 lon: 0_i32,
14325 alt: 0_i32,
14326 eph: 0_u16,
14327 epv: 0_u16,
14328 vel: 0_u16,
14329 cog: 0_u16,
14330 fix_type: GpsFixType::DEFAULT,
14331 satellites_visible: 0_u8,
14332 alt_ellipsoid: 0_i32,
14333 h_acc: 0_u32,
14334 v_acc: 0_u32,
14335 vel_acc: 0_u32,
14336 hdg_acc: 0_u32,
14337 yaw: 0_u16,
14338 };
14339 #[cfg(feature = "arbitrary")]
14340 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
14341 use arbitrary::{Arbitrary, Unstructured};
14342 let mut buf = [0u8; 1024];
14343 rng.fill_bytes(&mut buf);
14344 let mut unstructured = Unstructured::new(&buf);
14345 Self::arbitrary(&mut unstructured).unwrap_or_default()
14346 }
14347}
14348impl Default for GPS_RAW_INT_DATA {
14349 fn default() -> Self {
14350 Self::DEFAULT.clone()
14351 }
14352}
14353impl MessageData for GPS_RAW_INT_DATA {
14354 type Message = MavMessage;
14355 const ID: u32 = 24u32;
14356 const NAME: &'static str = "GPS_RAW_INT";
14357 const EXTRA_CRC: u8 = 24u8;
14358 const ENCODED_LEN: usize = 52usize;
14359 fn deser(
14360 _version: MavlinkVersion,
14361 __input: &[u8],
14362 ) -> Result<Self, ::mavlink_core::error::ParserError> {
14363 let avail_len = __input.len();
14364 let mut payload_buf = [0; Self::ENCODED_LEN];
14365 let mut buf = if avail_len < Self::ENCODED_LEN {
14366 payload_buf[0..avail_len].copy_from_slice(__input);
14367 Bytes::new(&payload_buf)
14368 } else {
14369 Bytes::new(__input)
14370 };
14371 let mut __struct = Self::default();
14372 __struct.time_usec = buf.get_u64_le();
14373 __struct.lat = buf.get_i32_le();
14374 __struct.lon = buf.get_i32_le();
14375 __struct.alt = buf.get_i32_le();
14376 __struct.eph = buf.get_u16_le();
14377 __struct.epv = buf.get_u16_le();
14378 __struct.vel = buf.get_u16_le();
14379 __struct.cog = buf.get_u16_le();
14380 let tmp = buf.get_u8();
14381 __struct.fix_type =
14382 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
14383 enum_type: "GpsFixType",
14384 value: tmp as u64,
14385 })?;
14386 __struct.satellites_visible = buf.get_u8();
14387 __struct.alt_ellipsoid = buf.get_i32_le();
14388 __struct.h_acc = buf.get_u32_le();
14389 __struct.v_acc = buf.get_u32_le();
14390 __struct.vel_acc = buf.get_u32_le();
14391 __struct.hdg_acc = buf.get_u32_le();
14392 __struct.yaw = buf.get_u16_le();
14393 Ok(__struct)
14394 }
14395 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
14396 let mut __tmp = BytesMut::new(bytes);
14397 #[allow(clippy::absurd_extreme_comparisons)]
14398 #[allow(unused_comparisons)]
14399 if __tmp.remaining() < Self::ENCODED_LEN {
14400 panic!(
14401 "buffer is too small (need {} bytes, but got {})",
14402 Self::ENCODED_LEN,
14403 __tmp.remaining(),
14404 )
14405 }
14406 __tmp.put_u64_le(self.time_usec);
14407 __tmp.put_i32_le(self.lat);
14408 __tmp.put_i32_le(self.lon);
14409 __tmp.put_i32_le(self.alt);
14410 __tmp.put_u16_le(self.eph);
14411 __tmp.put_u16_le(self.epv);
14412 __tmp.put_u16_le(self.vel);
14413 __tmp.put_u16_le(self.cog);
14414 __tmp.put_u8(self.fix_type as u8);
14415 __tmp.put_u8(self.satellites_visible);
14416 if matches!(version, MavlinkVersion::V2) {
14417 __tmp.put_i32_le(self.alt_ellipsoid);
14418 __tmp.put_u32_le(self.h_acc);
14419 __tmp.put_u32_le(self.v_acc);
14420 __tmp.put_u32_le(self.vel_acc);
14421 __tmp.put_u32_le(self.hdg_acc);
14422 __tmp.put_u16_le(self.yaw);
14423 let len = __tmp.len();
14424 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
14425 } else {
14426 __tmp.len()
14427 }
14428 }
14429}
14430#[doc = "RTCM message for injecting into the onboard GPS (used for DGPS)."]
14431#[doc = ""]
14432#[doc = "ID: 233"]
14433#[derive(Debug, Clone, PartialEq)]
14434#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
14435#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
14436#[cfg_attr(feature = "ts", derive(TS))]
14437#[cfg_attr(feature = "ts", ts(export))]
14438pub struct GPS_RTCM_DATA_DATA {
14439 #[doc = "LSB: 1 means message is fragmented, next 2 bits are the fragment ID, the remaining 5 bits are used for the sequence ID. Messages are only to be flushed to the GPS when the entire message has been reconstructed on the autopilot. The fragment ID specifies which order the fragments should be assembled into a buffer, while the sequence ID is used to detect a mismatch between different buffers. The buffer is considered fully reconstructed when either all 4 fragments are present, or all the fragments before the first fragment with a non full payload is received. This management is used to ensure that normal GPS operation doesn't corrupt RTCM data, and to recover from a unreliable transport delivery order."]
14440 pub flags: u8,
14441 #[doc = "data length"]
14442 pub len: u8,
14443 #[doc = "RTCM message (may be fragmented)"]
14444 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
14445 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
14446 pub data: [u8; 180],
14447}
14448impl GPS_RTCM_DATA_DATA {
14449 pub const ENCODED_LEN: usize = 182usize;
14450 pub const DEFAULT: Self = Self {
14451 flags: 0_u8,
14452 len: 0_u8,
14453 data: [0_u8; 180usize],
14454 };
14455 #[cfg(feature = "arbitrary")]
14456 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
14457 use arbitrary::{Arbitrary, Unstructured};
14458 let mut buf = [0u8; 1024];
14459 rng.fill_bytes(&mut buf);
14460 let mut unstructured = Unstructured::new(&buf);
14461 Self::arbitrary(&mut unstructured).unwrap_or_default()
14462 }
14463}
14464impl Default for GPS_RTCM_DATA_DATA {
14465 fn default() -> Self {
14466 Self::DEFAULT.clone()
14467 }
14468}
14469impl MessageData for GPS_RTCM_DATA_DATA {
14470 type Message = MavMessage;
14471 const ID: u32 = 233u32;
14472 const NAME: &'static str = "GPS_RTCM_DATA";
14473 const EXTRA_CRC: u8 = 35u8;
14474 const ENCODED_LEN: usize = 182usize;
14475 fn deser(
14476 _version: MavlinkVersion,
14477 __input: &[u8],
14478 ) -> Result<Self, ::mavlink_core::error::ParserError> {
14479 let avail_len = __input.len();
14480 let mut payload_buf = [0; Self::ENCODED_LEN];
14481 let mut buf = if avail_len < Self::ENCODED_LEN {
14482 payload_buf[0..avail_len].copy_from_slice(__input);
14483 Bytes::new(&payload_buf)
14484 } else {
14485 Bytes::new(__input)
14486 };
14487 let mut __struct = Self::default();
14488 __struct.flags = buf.get_u8();
14489 __struct.len = buf.get_u8();
14490 for v in &mut __struct.data {
14491 let val = buf.get_u8();
14492 *v = val;
14493 }
14494 Ok(__struct)
14495 }
14496 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
14497 let mut __tmp = BytesMut::new(bytes);
14498 #[allow(clippy::absurd_extreme_comparisons)]
14499 #[allow(unused_comparisons)]
14500 if __tmp.remaining() < Self::ENCODED_LEN {
14501 panic!(
14502 "buffer is too small (need {} bytes, but got {})",
14503 Self::ENCODED_LEN,
14504 __tmp.remaining(),
14505 )
14506 }
14507 __tmp.put_u8(self.flags);
14508 __tmp.put_u8(self.len);
14509 for val in &self.data {
14510 __tmp.put_u8(*val);
14511 }
14512 if matches!(version, MavlinkVersion::V2) {
14513 let len = __tmp.len();
14514 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
14515 } else {
14516 __tmp.len()
14517 }
14518 }
14519}
14520#[doc = "RTK GPS data. Gives information on the relative baseline calculation the GPS is reporting."]
14521#[doc = ""]
14522#[doc = "ID: 127"]
14523#[derive(Debug, Clone, PartialEq)]
14524#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
14525#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
14526#[cfg_attr(feature = "ts", derive(TS))]
14527#[cfg_attr(feature = "ts", ts(export))]
14528pub struct GPS_RTK_DATA {
14529 #[doc = "Time since boot of last baseline message received."]
14530 pub time_last_baseline_ms: u32,
14531 #[doc = "GPS Time of Week of last baseline"]
14532 pub tow: u32,
14533 #[doc = "Current baseline in ECEF x or NED north component."]
14534 pub baseline_a_mm: i32,
14535 #[doc = "Current baseline in ECEF y or NED east component."]
14536 pub baseline_b_mm: i32,
14537 #[doc = "Current baseline in ECEF z or NED down component."]
14538 pub baseline_c_mm: i32,
14539 #[doc = "Current estimate of baseline accuracy."]
14540 pub accuracy: u32,
14541 #[doc = "Current number of integer ambiguity hypotheses."]
14542 pub iar_num_hypotheses: i32,
14543 #[doc = "GPS Week Number of last baseline"]
14544 pub wn: u16,
14545 #[doc = "Identification of connected RTK receiver."]
14546 pub rtk_receiver_id: u8,
14547 #[doc = "GPS-specific health report for RTK data."]
14548 pub rtk_health: u8,
14549 #[doc = "Rate of baseline messages being received by GPS"]
14550 pub rtk_rate: u8,
14551 #[doc = "Current number of sats used for RTK calculation."]
14552 pub nsats: u8,
14553 #[doc = "Coordinate system of baseline"]
14554 pub baseline_coords_type: RtkBaselineCoordinateSystem,
14555}
14556impl GPS_RTK_DATA {
14557 pub const ENCODED_LEN: usize = 35usize;
14558 pub const DEFAULT: Self = Self {
14559 time_last_baseline_ms: 0_u32,
14560 tow: 0_u32,
14561 baseline_a_mm: 0_i32,
14562 baseline_b_mm: 0_i32,
14563 baseline_c_mm: 0_i32,
14564 accuracy: 0_u32,
14565 iar_num_hypotheses: 0_i32,
14566 wn: 0_u16,
14567 rtk_receiver_id: 0_u8,
14568 rtk_health: 0_u8,
14569 rtk_rate: 0_u8,
14570 nsats: 0_u8,
14571 baseline_coords_type: RtkBaselineCoordinateSystem::DEFAULT,
14572 };
14573 #[cfg(feature = "arbitrary")]
14574 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
14575 use arbitrary::{Arbitrary, Unstructured};
14576 let mut buf = [0u8; 1024];
14577 rng.fill_bytes(&mut buf);
14578 let mut unstructured = Unstructured::new(&buf);
14579 Self::arbitrary(&mut unstructured).unwrap_or_default()
14580 }
14581}
14582impl Default for GPS_RTK_DATA {
14583 fn default() -> Self {
14584 Self::DEFAULT.clone()
14585 }
14586}
14587impl MessageData for GPS_RTK_DATA {
14588 type Message = MavMessage;
14589 const ID: u32 = 127u32;
14590 const NAME: &'static str = "GPS_RTK";
14591 const EXTRA_CRC: u8 = 25u8;
14592 const ENCODED_LEN: usize = 35usize;
14593 fn deser(
14594 _version: MavlinkVersion,
14595 __input: &[u8],
14596 ) -> Result<Self, ::mavlink_core::error::ParserError> {
14597 let avail_len = __input.len();
14598 let mut payload_buf = [0; Self::ENCODED_LEN];
14599 let mut buf = if avail_len < Self::ENCODED_LEN {
14600 payload_buf[0..avail_len].copy_from_slice(__input);
14601 Bytes::new(&payload_buf)
14602 } else {
14603 Bytes::new(__input)
14604 };
14605 let mut __struct = Self::default();
14606 __struct.time_last_baseline_ms = buf.get_u32_le();
14607 __struct.tow = buf.get_u32_le();
14608 __struct.baseline_a_mm = buf.get_i32_le();
14609 __struct.baseline_b_mm = buf.get_i32_le();
14610 __struct.baseline_c_mm = buf.get_i32_le();
14611 __struct.accuracy = buf.get_u32_le();
14612 __struct.iar_num_hypotheses = buf.get_i32_le();
14613 __struct.wn = buf.get_u16_le();
14614 __struct.rtk_receiver_id = buf.get_u8();
14615 __struct.rtk_health = buf.get_u8();
14616 __struct.rtk_rate = buf.get_u8();
14617 __struct.nsats = buf.get_u8();
14618 let tmp = buf.get_u8();
14619 __struct.baseline_coords_type =
14620 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
14621 enum_type: "RtkBaselineCoordinateSystem",
14622 value: tmp as u64,
14623 })?;
14624 Ok(__struct)
14625 }
14626 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
14627 let mut __tmp = BytesMut::new(bytes);
14628 #[allow(clippy::absurd_extreme_comparisons)]
14629 #[allow(unused_comparisons)]
14630 if __tmp.remaining() < Self::ENCODED_LEN {
14631 panic!(
14632 "buffer is too small (need {} bytes, but got {})",
14633 Self::ENCODED_LEN,
14634 __tmp.remaining(),
14635 )
14636 }
14637 __tmp.put_u32_le(self.time_last_baseline_ms);
14638 __tmp.put_u32_le(self.tow);
14639 __tmp.put_i32_le(self.baseline_a_mm);
14640 __tmp.put_i32_le(self.baseline_b_mm);
14641 __tmp.put_i32_le(self.baseline_c_mm);
14642 __tmp.put_u32_le(self.accuracy);
14643 __tmp.put_i32_le(self.iar_num_hypotheses);
14644 __tmp.put_u16_le(self.wn);
14645 __tmp.put_u8(self.rtk_receiver_id);
14646 __tmp.put_u8(self.rtk_health);
14647 __tmp.put_u8(self.rtk_rate);
14648 __tmp.put_u8(self.nsats);
14649 __tmp.put_u8(self.baseline_coords_type as u8);
14650 if matches!(version, MavlinkVersion::V2) {
14651 let len = __tmp.len();
14652 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
14653 } else {
14654 __tmp.len()
14655 }
14656 }
14657}
14658#[doc = "The positioning status, as reported by GPS. This message is intended to display status information about each satellite visible to the receiver. See message GLOBAL_POSITION_INT for the global position estimate. This message can contain information for up to 20 satellites."]
14659#[doc = ""]
14660#[doc = "ID: 25"]
14661#[derive(Debug, Clone, PartialEq)]
14662#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
14663#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
14664#[cfg_attr(feature = "ts", derive(TS))]
14665#[cfg_attr(feature = "ts", ts(export))]
14666pub struct GPS_STATUS_DATA {
14667 #[doc = "Number of satellites visible"]
14668 pub satellites_visible: u8,
14669 #[doc = "Global satellite ID"]
14670 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
14671 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
14672 pub satellite_prn: [u8; 20],
14673 #[doc = "0: Satellite not used, 1: used for localization"]
14674 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
14675 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
14676 pub satellite_used: [u8; 20],
14677 #[doc = "Elevation (0: right on top of receiver, 90: on the horizon) of satellite"]
14678 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
14679 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
14680 pub satellite_elevation: [u8; 20],
14681 #[doc = "Direction of satellite, 0: 0 deg, 255: 360 deg."]
14682 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
14683 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
14684 pub satellite_azimuth: [u8; 20],
14685 #[doc = "Signal to noise ratio of satellite"]
14686 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
14687 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
14688 pub satellite_snr: [u8; 20],
14689}
14690impl GPS_STATUS_DATA {
14691 pub const ENCODED_LEN: usize = 101usize;
14692 pub const DEFAULT: Self = Self {
14693 satellites_visible: 0_u8,
14694 satellite_prn: [0_u8; 20usize],
14695 satellite_used: [0_u8; 20usize],
14696 satellite_elevation: [0_u8; 20usize],
14697 satellite_azimuth: [0_u8; 20usize],
14698 satellite_snr: [0_u8; 20usize],
14699 };
14700 #[cfg(feature = "arbitrary")]
14701 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
14702 use arbitrary::{Arbitrary, Unstructured};
14703 let mut buf = [0u8; 1024];
14704 rng.fill_bytes(&mut buf);
14705 let mut unstructured = Unstructured::new(&buf);
14706 Self::arbitrary(&mut unstructured).unwrap_or_default()
14707 }
14708}
14709impl Default for GPS_STATUS_DATA {
14710 fn default() -> Self {
14711 Self::DEFAULT.clone()
14712 }
14713}
14714impl MessageData for GPS_STATUS_DATA {
14715 type Message = MavMessage;
14716 const ID: u32 = 25u32;
14717 const NAME: &'static str = "GPS_STATUS";
14718 const EXTRA_CRC: u8 = 23u8;
14719 const ENCODED_LEN: usize = 101usize;
14720 fn deser(
14721 _version: MavlinkVersion,
14722 __input: &[u8],
14723 ) -> Result<Self, ::mavlink_core::error::ParserError> {
14724 let avail_len = __input.len();
14725 let mut payload_buf = [0; Self::ENCODED_LEN];
14726 let mut buf = if avail_len < Self::ENCODED_LEN {
14727 payload_buf[0..avail_len].copy_from_slice(__input);
14728 Bytes::new(&payload_buf)
14729 } else {
14730 Bytes::new(__input)
14731 };
14732 let mut __struct = Self::default();
14733 __struct.satellites_visible = buf.get_u8();
14734 for v in &mut __struct.satellite_prn {
14735 let val = buf.get_u8();
14736 *v = val;
14737 }
14738 for v in &mut __struct.satellite_used {
14739 let val = buf.get_u8();
14740 *v = val;
14741 }
14742 for v in &mut __struct.satellite_elevation {
14743 let val = buf.get_u8();
14744 *v = val;
14745 }
14746 for v in &mut __struct.satellite_azimuth {
14747 let val = buf.get_u8();
14748 *v = val;
14749 }
14750 for v in &mut __struct.satellite_snr {
14751 let val = buf.get_u8();
14752 *v = val;
14753 }
14754 Ok(__struct)
14755 }
14756 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
14757 let mut __tmp = BytesMut::new(bytes);
14758 #[allow(clippy::absurd_extreme_comparisons)]
14759 #[allow(unused_comparisons)]
14760 if __tmp.remaining() < Self::ENCODED_LEN {
14761 panic!(
14762 "buffer is too small (need {} bytes, but got {})",
14763 Self::ENCODED_LEN,
14764 __tmp.remaining(),
14765 )
14766 }
14767 __tmp.put_u8(self.satellites_visible);
14768 for val in &self.satellite_prn {
14769 __tmp.put_u8(*val);
14770 }
14771 for val in &self.satellite_used {
14772 __tmp.put_u8(*val);
14773 }
14774 for val in &self.satellite_elevation {
14775 __tmp.put_u8(*val);
14776 }
14777 for val in &self.satellite_azimuth {
14778 __tmp.put_u8(*val);
14779 }
14780 for val in &self.satellite_snr {
14781 __tmp.put_u8(*val);
14782 }
14783 if matches!(version, MavlinkVersion::V2) {
14784 let len = __tmp.len();
14785 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
14786 } else {
14787 __tmp.len()
14788 }
14789 }
14790}
14791#[doc = "The heartbeat message shows that a system or component is present and responding. The type and autopilot fields (along with the message component id), allow the receiving system to treat further messages from this system appropriately (e.g. by laying out the user interface based on the autopilot). This microservice is documented at <https://mavlink.io/en/services/heartbeat.html>."]
14792#[doc = ""]
14793#[doc = "ID: 0"]
14794#[derive(Debug, Clone, PartialEq)]
14795#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
14796#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
14797#[cfg_attr(feature = "ts", derive(TS))]
14798#[cfg_attr(feature = "ts", ts(export))]
14799pub struct HEARTBEAT_DATA {
14800 #[doc = "A bitfield for use for autopilot-specific flags"]
14801 pub custom_mode: u32,
14802 #[doc = "Vehicle or component type. For a flight controller component the vehicle type (quadrotor, helicopter, etc.). For other components the component type (e.g. camera, gimbal, etc.). This should be used in preference to component id for identifying the component type."]
14803 pub mavtype: MavType,
14804 #[doc = "Autopilot type / class. Use MAV_AUTOPILOT_INVALID for components that are not flight controllers."]
14805 pub autopilot: MavAutopilot,
14806 #[doc = "System mode bitmap."]
14807 pub base_mode: MavModeFlag,
14808 #[doc = "System status flag."]
14809 pub system_status: MavState,
14810 #[doc = "MAVLink version, not writable by user, gets added by protocol because of magic data type: uint8_t_mavlink_version"]
14811 pub mavlink_version: u8,
14812}
14813impl HEARTBEAT_DATA {
14814 pub const ENCODED_LEN: usize = 9usize;
14815 pub const DEFAULT: Self = Self {
14816 custom_mode: 0_u32,
14817 mavtype: MavType::DEFAULT,
14818 autopilot: MavAutopilot::DEFAULT,
14819 base_mode: MavModeFlag::DEFAULT,
14820 system_status: MavState::DEFAULT,
14821 mavlink_version: MINOR_MAVLINK_VERSION,
14822 };
14823 #[cfg(feature = "arbitrary")]
14824 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
14825 use arbitrary::{Arbitrary, Unstructured};
14826 let mut buf = [0u8; 1024];
14827 rng.fill_bytes(&mut buf);
14828 let mut unstructured = Unstructured::new(&buf);
14829 Self::arbitrary(&mut unstructured).unwrap_or_default()
14830 }
14831}
14832impl Default for HEARTBEAT_DATA {
14833 fn default() -> Self {
14834 Self::DEFAULT.clone()
14835 }
14836}
14837impl MessageData for HEARTBEAT_DATA {
14838 type Message = MavMessage;
14839 const ID: u32 = 0u32;
14840 const NAME: &'static str = "HEARTBEAT";
14841 const EXTRA_CRC: u8 = 50u8;
14842 const ENCODED_LEN: usize = 9usize;
14843 fn deser(
14844 _version: MavlinkVersion,
14845 __input: &[u8],
14846 ) -> Result<Self, ::mavlink_core::error::ParserError> {
14847 let avail_len = __input.len();
14848 let mut payload_buf = [0; Self::ENCODED_LEN];
14849 let mut buf = if avail_len < Self::ENCODED_LEN {
14850 payload_buf[0..avail_len].copy_from_slice(__input);
14851 Bytes::new(&payload_buf)
14852 } else {
14853 Bytes::new(__input)
14854 };
14855 let mut __struct = Self::default();
14856 __struct.custom_mode = buf.get_u32_le();
14857 let tmp = buf.get_u8();
14858 __struct.mavtype =
14859 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
14860 enum_type: "MavType",
14861 value: tmp as u64,
14862 })?;
14863 let tmp = buf.get_u8();
14864 __struct.autopilot =
14865 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
14866 enum_type: "MavAutopilot",
14867 value: tmp as u64,
14868 })?;
14869 let tmp = buf.get_u8();
14870 __struct.base_mode = MavModeFlag::from_bits(tmp as <MavModeFlag as Flags>::Bits).ok_or(
14871 ::mavlink_core::error::ParserError::InvalidFlag {
14872 flag_type: "MavModeFlag",
14873 value: tmp as u64,
14874 },
14875 )?;
14876 let tmp = buf.get_u8();
14877 __struct.system_status =
14878 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
14879 enum_type: "MavState",
14880 value: tmp as u64,
14881 })?;
14882 __struct.mavlink_version = buf.get_u8();
14883 Ok(__struct)
14884 }
14885 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
14886 let mut __tmp = BytesMut::new(bytes);
14887 #[allow(clippy::absurd_extreme_comparisons)]
14888 #[allow(unused_comparisons)]
14889 if __tmp.remaining() < Self::ENCODED_LEN {
14890 panic!(
14891 "buffer is too small (need {} bytes, but got {})",
14892 Self::ENCODED_LEN,
14893 __tmp.remaining(),
14894 )
14895 }
14896 __tmp.put_u32_le(self.custom_mode);
14897 __tmp.put_u8(self.mavtype as u8);
14898 __tmp.put_u8(self.autopilot as u8);
14899 __tmp.put_u8(self.base_mode.bits() as u8);
14900 __tmp.put_u8(self.system_status as u8);
14901 __tmp.put_u8(self.mavlink_version);
14902 if matches!(version, MavlinkVersion::V2) {
14903 let len = __tmp.len();
14904 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
14905 } else {
14906 __tmp.len()
14907 }
14908 }
14909}
14910#[doc = "The IMU readings in SI units in NED body frame."]
14911#[doc = ""]
14912#[doc = "ID: 105"]
14913#[derive(Debug, Clone, PartialEq)]
14914#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
14915#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
14916#[cfg_attr(feature = "ts", derive(TS))]
14917#[cfg_attr(feature = "ts", ts(export))]
14918pub struct HIGHRES_IMU_DATA {
14919 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
14920 pub time_usec: u64,
14921 #[doc = "X acceleration"]
14922 pub xacc: f32,
14923 #[doc = "Y acceleration"]
14924 pub yacc: f32,
14925 #[doc = "Z acceleration"]
14926 pub zacc: f32,
14927 #[doc = "Angular speed around X axis"]
14928 pub xgyro: f32,
14929 #[doc = "Angular speed around Y axis"]
14930 pub ygyro: f32,
14931 #[doc = "Angular speed around Z axis"]
14932 pub zgyro: f32,
14933 #[doc = "X Magnetic field"]
14934 pub xmag: f32,
14935 #[doc = "Y Magnetic field"]
14936 pub ymag: f32,
14937 #[doc = "Z Magnetic field"]
14938 pub zmag: f32,
14939 #[doc = "Absolute pressure"]
14940 pub abs_pressure: f32,
14941 #[doc = "Differential pressure"]
14942 pub diff_pressure: f32,
14943 #[doc = "Altitude calculated from pressure"]
14944 pub pressure_alt: f32,
14945 #[doc = "Temperature"]
14946 pub temperature: f32,
14947 #[doc = "Bitmap for fields that have updated since last message"]
14948 pub fields_updated: HighresImuUpdatedFlags,
14949 #[doc = "Id. Ids are numbered from 0 and map to IMUs numbered from 1 (e.g. IMU1 will have a message with id=0)"]
14950 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
14951 pub id: u8,
14952}
14953impl HIGHRES_IMU_DATA {
14954 pub const ENCODED_LEN: usize = 63usize;
14955 pub const DEFAULT: Self = Self {
14956 time_usec: 0_u64,
14957 xacc: 0.0_f32,
14958 yacc: 0.0_f32,
14959 zacc: 0.0_f32,
14960 xgyro: 0.0_f32,
14961 ygyro: 0.0_f32,
14962 zgyro: 0.0_f32,
14963 xmag: 0.0_f32,
14964 ymag: 0.0_f32,
14965 zmag: 0.0_f32,
14966 abs_pressure: 0.0_f32,
14967 diff_pressure: 0.0_f32,
14968 pressure_alt: 0.0_f32,
14969 temperature: 0.0_f32,
14970 fields_updated: HighresImuUpdatedFlags::DEFAULT,
14971 id: 0_u8,
14972 };
14973 #[cfg(feature = "arbitrary")]
14974 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
14975 use arbitrary::{Arbitrary, Unstructured};
14976 let mut buf = [0u8; 1024];
14977 rng.fill_bytes(&mut buf);
14978 let mut unstructured = Unstructured::new(&buf);
14979 Self::arbitrary(&mut unstructured).unwrap_or_default()
14980 }
14981}
14982impl Default for HIGHRES_IMU_DATA {
14983 fn default() -> Self {
14984 Self::DEFAULT.clone()
14985 }
14986}
14987impl MessageData for HIGHRES_IMU_DATA {
14988 type Message = MavMessage;
14989 const ID: u32 = 105u32;
14990 const NAME: &'static str = "HIGHRES_IMU";
14991 const EXTRA_CRC: u8 = 93u8;
14992 const ENCODED_LEN: usize = 63usize;
14993 fn deser(
14994 _version: MavlinkVersion,
14995 __input: &[u8],
14996 ) -> Result<Self, ::mavlink_core::error::ParserError> {
14997 let avail_len = __input.len();
14998 let mut payload_buf = [0; Self::ENCODED_LEN];
14999 let mut buf = if avail_len < Self::ENCODED_LEN {
15000 payload_buf[0..avail_len].copy_from_slice(__input);
15001 Bytes::new(&payload_buf)
15002 } else {
15003 Bytes::new(__input)
15004 };
15005 let mut __struct = Self::default();
15006 __struct.time_usec = buf.get_u64_le();
15007 __struct.xacc = buf.get_f32_le();
15008 __struct.yacc = buf.get_f32_le();
15009 __struct.zacc = buf.get_f32_le();
15010 __struct.xgyro = buf.get_f32_le();
15011 __struct.ygyro = buf.get_f32_le();
15012 __struct.zgyro = buf.get_f32_le();
15013 __struct.xmag = buf.get_f32_le();
15014 __struct.ymag = buf.get_f32_le();
15015 __struct.zmag = buf.get_f32_le();
15016 __struct.abs_pressure = buf.get_f32_le();
15017 __struct.diff_pressure = buf.get_f32_le();
15018 __struct.pressure_alt = buf.get_f32_le();
15019 __struct.temperature = buf.get_f32_le();
15020 let tmp = buf.get_u16_le();
15021 __struct.fields_updated =
15022 HighresImuUpdatedFlags::from_bits(tmp as <HighresImuUpdatedFlags as Flags>::Bits)
15023 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
15024 flag_type: "HighresImuUpdatedFlags",
15025 value: tmp as u64,
15026 })?;
15027 __struct.id = buf.get_u8();
15028 Ok(__struct)
15029 }
15030 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
15031 let mut __tmp = BytesMut::new(bytes);
15032 #[allow(clippy::absurd_extreme_comparisons)]
15033 #[allow(unused_comparisons)]
15034 if __tmp.remaining() < Self::ENCODED_LEN {
15035 panic!(
15036 "buffer is too small (need {} bytes, but got {})",
15037 Self::ENCODED_LEN,
15038 __tmp.remaining(),
15039 )
15040 }
15041 __tmp.put_u64_le(self.time_usec);
15042 __tmp.put_f32_le(self.xacc);
15043 __tmp.put_f32_le(self.yacc);
15044 __tmp.put_f32_le(self.zacc);
15045 __tmp.put_f32_le(self.xgyro);
15046 __tmp.put_f32_le(self.ygyro);
15047 __tmp.put_f32_le(self.zgyro);
15048 __tmp.put_f32_le(self.xmag);
15049 __tmp.put_f32_le(self.ymag);
15050 __tmp.put_f32_le(self.zmag);
15051 __tmp.put_f32_le(self.abs_pressure);
15052 __tmp.put_f32_le(self.diff_pressure);
15053 __tmp.put_f32_le(self.pressure_alt);
15054 __tmp.put_f32_le(self.temperature);
15055 __tmp.put_u16_le(self.fields_updated.bits() as u16);
15056 if matches!(version, MavlinkVersion::V2) {
15057 __tmp.put_u8(self.id);
15058 let len = __tmp.len();
15059 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
15060 } else {
15061 __tmp.len()
15062 }
15063 }
15064}
15065#[deprecated = " See `HIGH_LATENCY2` (Deprecated since 2020-10)"]
15066#[doc = "Message appropriate for high latency connections like Iridium."]
15067#[doc = ""]
15068#[doc = "ID: 234"]
15069#[derive(Debug, Clone, PartialEq)]
15070#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
15071#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
15072#[cfg_attr(feature = "ts", derive(TS))]
15073#[cfg_attr(feature = "ts", ts(export))]
15074pub struct HIGH_LATENCY_DATA {
15075 #[doc = "A bitfield for use for autopilot-specific flags."]
15076 pub custom_mode: u32,
15077 #[doc = "Latitude"]
15078 pub latitude: i32,
15079 #[doc = "Longitude"]
15080 pub longitude: i32,
15081 #[doc = "roll"]
15082 pub roll: i16,
15083 #[doc = "pitch"]
15084 pub pitch: i16,
15085 #[doc = "heading"]
15086 pub heading: u16,
15087 #[doc = "heading setpoint"]
15088 pub heading_sp: i16,
15089 #[doc = "Altitude above mean sea level"]
15090 pub altitude_amsl: i16,
15091 #[doc = "Altitude setpoint relative to the home position"]
15092 pub altitude_sp: i16,
15093 #[doc = "distance to target"]
15094 pub wp_distance: u16,
15095 #[doc = "Bitmap of enabled system modes."]
15096 pub base_mode: MavModeFlag,
15097 #[doc = "The landed state. Is set to MAV_LANDED_STATE_UNDEFINED if landed state is unknown."]
15098 pub landed_state: MavLandedState,
15099 #[doc = "throttle (percentage)"]
15100 pub throttle: i8,
15101 #[doc = "airspeed"]
15102 pub airspeed: u8,
15103 #[doc = "airspeed setpoint"]
15104 pub airspeed_sp: u8,
15105 #[doc = "groundspeed"]
15106 pub groundspeed: u8,
15107 #[doc = "climb rate"]
15108 pub climb_rate: i8,
15109 #[doc = "Number of satellites visible. If unknown, set to UINT8_MAX"]
15110 pub gps_nsat: u8,
15111 #[doc = "GPS Fix type."]
15112 pub gps_fix_type: GpsFixType,
15113 #[doc = "Remaining battery (percentage)"]
15114 pub battery_remaining: u8,
15115 #[doc = "Autopilot temperature (degrees C)"]
15116 pub temperature: i8,
15117 #[doc = "Air temperature (degrees C) from airspeed sensor"]
15118 pub temperature_air: i8,
15119 #[doc = "failsafe (each bit represents a failsafe where 0=ok, 1=failsafe active (bit0:RC, bit1:batt, bit2:GPS, bit3:GCS, bit4:fence)"]
15120 pub failsafe: u8,
15121 #[doc = "current waypoint number"]
15122 pub wp_num: u8,
15123}
15124impl HIGH_LATENCY_DATA {
15125 pub const ENCODED_LEN: usize = 40usize;
15126 pub const DEFAULT: Self = Self {
15127 custom_mode: 0_u32,
15128 latitude: 0_i32,
15129 longitude: 0_i32,
15130 roll: 0_i16,
15131 pitch: 0_i16,
15132 heading: 0_u16,
15133 heading_sp: 0_i16,
15134 altitude_amsl: 0_i16,
15135 altitude_sp: 0_i16,
15136 wp_distance: 0_u16,
15137 base_mode: MavModeFlag::DEFAULT,
15138 landed_state: MavLandedState::DEFAULT,
15139 throttle: 0_i8,
15140 airspeed: 0_u8,
15141 airspeed_sp: 0_u8,
15142 groundspeed: 0_u8,
15143 climb_rate: 0_i8,
15144 gps_nsat: 0_u8,
15145 gps_fix_type: GpsFixType::DEFAULT,
15146 battery_remaining: 0_u8,
15147 temperature: 0_i8,
15148 temperature_air: 0_i8,
15149 failsafe: 0_u8,
15150 wp_num: 0_u8,
15151 };
15152 #[cfg(feature = "arbitrary")]
15153 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
15154 use arbitrary::{Arbitrary, Unstructured};
15155 let mut buf = [0u8; 1024];
15156 rng.fill_bytes(&mut buf);
15157 let mut unstructured = Unstructured::new(&buf);
15158 Self::arbitrary(&mut unstructured).unwrap_or_default()
15159 }
15160}
15161impl Default for HIGH_LATENCY_DATA {
15162 fn default() -> Self {
15163 Self::DEFAULT.clone()
15164 }
15165}
15166impl MessageData for HIGH_LATENCY_DATA {
15167 type Message = MavMessage;
15168 const ID: u32 = 234u32;
15169 const NAME: &'static str = "HIGH_LATENCY";
15170 const EXTRA_CRC: u8 = 150u8;
15171 const ENCODED_LEN: usize = 40usize;
15172 fn deser(
15173 _version: MavlinkVersion,
15174 __input: &[u8],
15175 ) -> Result<Self, ::mavlink_core::error::ParserError> {
15176 let avail_len = __input.len();
15177 let mut payload_buf = [0; Self::ENCODED_LEN];
15178 let mut buf = if avail_len < Self::ENCODED_LEN {
15179 payload_buf[0..avail_len].copy_from_slice(__input);
15180 Bytes::new(&payload_buf)
15181 } else {
15182 Bytes::new(__input)
15183 };
15184 let mut __struct = Self::default();
15185 __struct.custom_mode = buf.get_u32_le();
15186 __struct.latitude = buf.get_i32_le();
15187 __struct.longitude = buf.get_i32_le();
15188 __struct.roll = buf.get_i16_le();
15189 __struct.pitch = buf.get_i16_le();
15190 __struct.heading = buf.get_u16_le();
15191 __struct.heading_sp = buf.get_i16_le();
15192 __struct.altitude_amsl = buf.get_i16_le();
15193 __struct.altitude_sp = buf.get_i16_le();
15194 __struct.wp_distance = buf.get_u16_le();
15195 let tmp = buf.get_u8();
15196 __struct.base_mode = MavModeFlag::from_bits(tmp as <MavModeFlag as Flags>::Bits).ok_or(
15197 ::mavlink_core::error::ParserError::InvalidFlag {
15198 flag_type: "MavModeFlag",
15199 value: tmp as u64,
15200 },
15201 )?;
15202 let tmp = buf.get_u8();
15203 __struct.landed_state =
15204 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
15205 enum_type: "MavLandedState",
15206 value: tmp as u64,
15207 })?;
15208 __struct.throttle = buf.get_i8();
15209 __struct.airspeed = buf.get_u8();
15210 __struct.airspeed_sp = buf.get_u8();
15211 __struct.groundspeed = buf.get_u8();
15212 __struct.climb_rate = buf.get_i8();
15213 __struct.gps_nsat = buf.get_u8();
15214 let tmp = buf.get_u8();
15215 __struct.gps_fix_type =
15216 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
15217 enum_type: "GpsFixType",
15218 value: tmp as u64,
15219 })?;
15220 __struct.battery_remaining = buf.get_u8();
15221 __struct.temperature = buf.get_i8();
15222 __struct.temperature_air = buf.get_i8();
15223 __struct.failsafe = buf.get_u8();
15224 __struct.wp_num = buf.get_u8();
15225 Ok(__struct)
15226 }
15227 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
15228 let mut __tmp = BytesMut::new(bytes);
15229 #[allow(clippy::absurd_extreme_comparisons)]
15230 #[allow(unused_comparisons)]
15231 if __tmp.remaining() < Self::ENCODED_LEN {
15232 panic!(
15233 "buffer is too small (need {} bytes, but got {})",
15234 Self::ENCODED_LEN,
15235 __tmp.remaining(),
15236 )
15237 }
15238 __tmp.put_u32_le(self.custom_mode);
15239 __tmp.put_i32_le(self.latitude);
15240 __tmp.put_i32_le(self.longitude);
15241 __tmp.put_i16_le(self.roll);
15242 __tmp.put_i16_le(self.pitch);
15243 __tmp.put_u16_le(self.heading);
15244 __tmp.put_i16_le(self.heading_sp);
15245 __tmp.put_i16_le(self.altitude_amsl);
15246 __tmp.put_i16_le(self.altitude_sp);
15247 __tmp.put_u16_le(self.wp_distance);
15248 __tmp.put_u8(self.base_mode.bits() as u8);
15249 __tmp.put_u8(self.landed_state as u8);
15250 __tmp.put_i8(self.throttle);
15251 __tmp.put_u8(self.airspeed);
15252 __tmp.put_u8(self.airspeed_sp);
15253 __tmp.put_u8(self.groundspeed);
15254 __tmp.put_i8(self.climb_rate);
15255 __tmp.put_u8(self.gps_nsat);
15256 __tmp.put_u8(self.gps_fix_type as u8);
15257 __tmp.put_u8(self.battery_remaining);
15258 __tmp.put_i8(self.temperature);
15259 __tmp.put_i8(self.temperature_air);
15260 __tmp.put_u8(self.failsafe);
15261 __tmp.put_u8(self.wp_num);
15262 if matches!(version, MavlinkVersion::V2) {
15263 let len = __tmp.len();
15264 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
15265 } else {
15266 __tmp.len()
15267 }
15268 }
15269}
15270#[doc = "Message appropriate for high latency connections like Iridium (version 2)."]
15271#[doc = ""]
15272#[doc = "ID: 235"]
15273#[derive(Debug, Clone, PartialEq)]
15274#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
15275#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
15276#[cfg_attr(feature = "ts", derive(TS))]
15277#[cfg_attr(feature = "ts", ts(export))]
15278pub struct HIGH_LATENCY2_DATA {
15279 #[doc = "Timestamp (milliseconds since boot or Unix epoch)"]
15280 pub timestamp: u32,
15281 #[doc = "Latitude"]
15282 pub latitude: i32,
15283 #[doc = "Longitude"]
15284 pub longitude: i32,
15285 #[doc = "A bitfield for use for autopilot-specific flags (2 byte version)."]
15286 pub custom_mode: u16,
15287 #[doc = "Altitude above mean sea level"]
15288 pub altitude: i16,
15289 #[doc = "Altitude setpoint"]
15290 pub target_altitude: i16,
15291 #[doc = "Distance to target waypoint or position"]
15292 pub target_distance: u16,
15293 #[doc = "Current waypoint number"]
15294 pub wp_num: u16,
15295 #[doc = "Bitmap of failure flags."]
15296 pub failure_flags: HlFailureFlag,
15297 #[doc = "Type of the MAV (quadrotor, helicopter, etc.)"]
15298 pub mavtype: MavType,
15299 #[doc = "Autopilot type / class. Use MAV_AUTOPILOT_INVALID for components that are not flight controllers."]
15300 pub autopilot: MavAutopilot,
15301 #[doc = "Heading"]
15302 pub heading: u8,
15303 #[doc = "Heading setpoint"]
15304 pub target_heading: u8,
15305 #[doc = "Throttle"]
15306 pub throttle: u8,
15307 #[doc = "Airspeed"]
15308 pub airspeed: u8,
15309 #[doc = "Airspeed setpoint"]
15310 pub airspeed_sp: u8,
15311 #[doc = "Groundspeed"]
15312 pub groundspeed: u8,
15313 #[doc = "Windspeed"]
15314 pub windspeed: u8,
15315 #[doc = "Wind heading"]
15316 pub wind_heading: u8,
15317 #[doc = "Maximum error horizontal position since last message"]
15318 pub eph: u8,
15319 #[doc = "Maximum error vertical position since last message"]
15320 pub epv: u8,
15321 #[doc = "Air temperature"]
15322 pub temperature_air: i8,
15323 #[doc = "Maximum climb rate magnitude since last message"]
15324 pub climb_rate: i8,
15325 #[doc = "Battery level (-1 if field not provided)."]
15326 pub battery: i8,
15327 #[doc = "Field for custom payload."]
15328 pub custom0: i8,
15329 #[doc = "Field for custom payload."]
15330 pub custom1: i8,
15331 #[doc = "Field for custom payload."]
15332 pub custom2: i8,
15333}
15334impl HIGH_LATENCY2_DATA {
15335 pub const ENCODED_LEN: usize = 42usize;
15336 pub const DEFAULT: Self = Self {
15337 timestamp: 0_u32,
15338 latitude: 0_i32,
15339 longitude: 0_i32,
15340 custom_mode: 0_u16,
15341 altitude: 0_i16,
15342 target_altitude: 0_i16,
15343 target_distance: 0_u16,
15344 wp_num: 0_u16,
15345 failure_flags: HlFailureFlag::DEFAULT,
15346 mavtype: MavType::DEFAULT,
15347 autopilot: MavAutopilot::DEFAULT,
15348 heading: 0_u8,
15349 target_heading: 0_u8,
15350 throttle: 0_u8,
15351 airspeed: 0_u8,
15352 airspeed_sp: 0_u8,
15353 groundspeed: 0_u8,
15354 windspeed: 0_u8,
15355 wind_heading: 0_u8,
15356 eph: 0_u8,
15357 epv: 0_u8,
15358 temperature_air: 0_i8,
15359 climb_rate: 0_i8,
15360 battery: 0_i8,
15361 custom0: 0_i8,
15362 custom1: 0_i8,
15363 custom2: 0_i8,
15364 };
15365 #[cfg(feature = "arbitrary")]
15366 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
15367 use arbitrary::{Arbitrary, Unstructured};
15368 let mut buf = [0u8; 1024];
15369 rng.fill_bytes(&mut buf);
15370 let mut unstructured = Unstructured::new(&buf);
15371 Self::arbitrary(&mut unstructured).unwrap_or_default()
15372 }
15373}
15374impl Default for HIGH_LATENCY2_DATA {
15375 fn default() -> Self {
15376 Self::DEFAULT.clone()
15377 }
15378}
15379impl MessageData for HIGH_LATENCY2_DATA {
15380 type Message = MavMessage;
15381 const ID: u32 = 235u32;
15382 const NAME: &'static str = "HIGH_LATENCY2";
15383 const EXTRA_CRC: u8 = 179u8;
15384 const ENCODED_LEN: usize = 42usize;
15385 fn deser(
15386 _version: MavlinkVersion,
15387 __input: &[u8],
15388 ) -> Result<Self, ::mavlink_core::error::ParserError> {
15389 let avail_len = __input.len();
15390 let mut payload_buf = [0; Self::ENCODED_LEN];
15391 let mut buf = if avail_len < Self::ENCODED_LEN {
15392 payload_buf[0..avail_len].copy_from_slice(__input);
15393 Bytes::new(&payload_buf)
15394 } else {
15395 Bytes::new(__input)
15396 };
15397 let mut __struct = Self::default();
15398 __struct.timestamp = buf.get_u32_le();
15399 __struct.latitude = buf.get_i32_le();
15400 __struct.longitude = buf.get_i32_le();
15401 __struct.custom_mode = buf.get_u16_le();
15402 __struct.altitude = buf.get_i16_le();
15403 __struct.target_altitude = buf.get_i16_le();
15404 __struct.target_distance = buf.get_u16_le();
15405 __struct.wp_num = buf.get_u16_le();
15406 let tmp = buf.get_u16_le();
15407 __struct.failure_flags = HlFailureFlag::from_bits(tmp as <HlFailureFlag as Flags>::Bits)
15408 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
15409 flag_type: "HlFailureFlag",
15410 value: tmp as u64,
15411 })?;
15412 let tmp = buf.get_u8();
15413 __struct.mavtype =
15414 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
15415 enum_type: "MavType",
15416 value: tmp as u64,
15417 })?;
15418 let tmp = buf.get_u8();
15419 __struct.autopilot =
15420 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
15421 enum_type: "MavAutopilot",
15422 value: tmp as u64,
15423 })?;
15424 __struct.heading = buf.get_u8();
15425 __struct.target_heading = buf.get_u8();
15426 __struct.throttle = buf.get_u8();
15427 __struct.airspeed = buf.get_u8();
15428 __struct.airspeed_sp = buf.get_u8();
15429 __struct.groundspeed = buf.get_u8();
15430 __struct.windspeed = buf.get_u8();
15431 __struct.wind_heading = buf.get_u8();
15432 __struct.eph = buf.get_u8();
15433 __struct.epv = buf.get_u8();
15434 __struct.temperature_air = buf.get_i8();
15435 __struct.climb_rate = buf.get_i8();
15436 __struct.battery = buf.get_i8();
15437 __struct.custom0 = buf.get_i8();
15438 __struct.custom1 = buf.get_i8();
15439 __struct.custom2 = buf.get_i8();
15440 Ok(__struct)
15441 }
15442 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
15443 let mut __tmp = BytesMut::new(bytes);
15444 #[allow(clippy::absurd_extreme_comparisons)]
15445 #[allow(unused_comparisons)]
15446 if __tmp.remaining() < Self::ENCODED_LEN {
15447 panic!(
15448 "buffer is too small (need {} bytes, but got {})",
15449 Self::ENCODED_LEN,
15450 __tmp.remaining(),
15451 )
15452 }
15453 __tmp.put_u32_le(self.timestamp);
15454 __tmp.put_i32_le(self.latitude);
15455 __tmp.put_i32_le(self.longitude);
15456 __tmp.put_u16_le(self.custom_mode);
15457 __tmp.put_i16_le(self.altitude);
15458 __tmp.put_i16_le(self.target_altitude);
15459 __tmp.put_u16_le(self.target_distance);
15460 __tmp.put_u16_le(self.wp_num);
15461 __tmp.put_u16_le(self.failure_flags.bits() as u16);
15462 __tmp.put_u8(self.mavtype as u8);
15463 __tmp.put_u8(self.autopilot as u8);
15464 __tmp.put_u8(self.heading);
15465 __tmp.put_u8(self.target_heading);
15466 __tmp.put_u8(self.throttle);
15467 __tmp.put_u8(self.airspeed);
15468 __tmp.put_u8(self.airspeed_sp);
15469 __tmp.put_u8(self.groundspeed);
15470 __tmp.put_u8(self.windspeed);
15471 __tmp.put_u8(self.wind_heading);
15472 __tmp.put_u8(self.eph);
15473 __tmp.put_u8(self.epv);
15474 __tmp.put_i8(self.temperature_air);
15475 __tmp.put_i8(self.climb_rate);
15476 __tmp.put_i8(self.battery);
15477 __tmp.put_i8(self.custom0);
15478 __tmp.put_i8(self.custom1);
15479 __tmp.put_i8(self.custom2);
15480 if matches!(version, MavlinkVersion::V2) {
15481 let len = __tmp.len();
15482 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
15483 } else {
15484 __tmp.len()
15485 }
15486 }
15487}
15488#[doc = "Sent from autopilot to simulation. Hardware in the loop control outputs. Alternative to HIL_CONTROLS."]
15489#[doc = ""]
15490#[doc = "ID: 93"]
15491#[derive(Debug, Clone, PartialEq)]
15492#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
15493#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
15494#[cfg_attr(feature = "ts", derive(TS))]
15495#[cfg_attr(feature = "ts", ts(export))]
15496pub struct HIL_ACTUATOR_CONTROLS_DATA {
15497 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
15498 pub time_usec: u64,
15499 #[doc = "Flags bitmask."]
15500 pub flags: HilActuatorControlsFlags,
15501 #[doc = "Control outputs -1 .. 1. Channel assignment depends on the simulated hardware."]
15502 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
15503 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
15504 pub controls: [f32; 16],
15505 #[doc = "System mode. Includes arming state."]
15506 pub mode: MavModeFlag,
15507}
15508impl HIL_ACTUATOR_CONTROLS_DATA {
15509 pub const ENCODED_LEN: usize = 81usize;
15510 pub const DEFAULT: Self = Self {
15511 time_usec: 0_u64,
15512 flags: HilActuatorControlsFlags::DEFAULT,
15513 controls: [0.0_f32; 16usize],
15514 mode: MavModeFlag::DEFAULT,
15515 };
15516 #[cfg(feature = "arbitrary")]
15517 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
15518 use arbitrary::{Arbitrary, Unstructured};
15519 let mut buf = [0u8; 1024];
15520 rng.fill_bytes(&mut buf);
15521 let mut unstructured = Unstructured::new(&buf);
15522 Self::arbitrary(&mut unstructured).unwrap_or_default()
15523 }
15524}
15525impl Default for HIL_ACTUATOR_CONTROLS_DATA {
15526 fn default() -> Self {
15527 Self::DEFAULT.clone()
15528 }
15529}
15530impl MessageData for HIL_ACTUATOR_CONTROLS_DATA {
15531 type Message = MavMessage;
15532 const ID: u32 = 93u32;
15533 const NAME: &'static str = "HIL_ACTUATOR_CONTROLS";
15534 const EXTRA_CRC: u8 = 47u8;
15535 const ENCODED_LEN: usize = 81usize;
15536 fn deser(
15537 _version: MavlinkVersion,
15538 __input: &[u8],
15539 ) -> Result<Self, ::mavlink_core::error::ParserError> {
15540 let avail_len = __input.len();
15541 let mut payload_buf = [0; Self::ENCODED_LEN];
15542 let mut buf = if avail_len < Self::ENCODED_LEN {
15543 payload_buf[0..avail_len].copy_from_slice(__input);
15544 Bytes::new(&payload_buf)
15545 } else {
15546 Bytes::new(__input)
15547 };
15548 let mut __struct = Self::default();
15549 __struct.time_usec = buf.get_u64_le();
15550 let tmp = buf.get_u64_le();
15551 __struct.flags =
15552 HilActuatorControlsFlags::from_bits(tmp as <HilActuatorControlsFlags as Flags>::Bits)
15553 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
15554 flag_type: "HilActuatorControlsFlags",
15555 value: tmp as u64,
15556 })?;
15557 for v in &mut __struct.controls {
15558 let val = buf.get_f32_le();
15559 *v = val;
15560 }
15561 let tmp = buf.get_u8();
15562 __struct.mode = MavModeFlag::from_bits(tmp as <MavModeFlag as Flags>::Bits).ok_or(
15563 ::mavlink_core::error::ParserError::InvalidFlag {
15564 flag_type: "MavModeFlag",
15565 value: tmp as u64,
15566 },
15567 )?;
15568 Ok(__struct)
15569 }
15570 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
15571 let mut __tmp = BytesMut::new(bytes);
15572 #[allow(clippy::absurd_extreme_comparisons)]
15573 #[allow(unused_comparisons)]
15574 if __tmp.remaining() < Self::ENCODED_LEN {
15575 panic!(
15576 "buffer is too small (need {} bytes, but got {})",
15577 Self::ENCODED_LEN,
15578 __tmp.remaining(),
15579 )
15580 }
15581 __tmp.put_u64_le(self.time_usec);
15582 __tmp.put_u64_le(self.flags.bits() as u64);
15583 for val in &self.controls {
15584 __tmp.put_f32_le(*val);
15585 }
15586 __tmp.put_u8(self.mode.bits() as u8);
15587 if matches!(version, MavlinkVersion::V2) {
15588 let len = __tmp.len();
15589 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
15590 } else {
15591 __tmp.len()
15592 }
15593 }
15594}
15595#[doc = "Sent from autopilot to simulation. Hardware in the loop control outputs. Alternative to HIL_ACTUATOR_CONTROLS."]
15596#[doc = ""]
15597#[doc = "ID: 91"]
15598#[derive(Debug, Clone, PartialEq)]
15599#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
15600#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
15601#[cfg_attr(feature = "ts", derive(TS))]
15602#[cfg_attr(feature = "ts", ts(export))]
15603pub struct HIL_CONTROLS_DATA {
15604 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
15605 pub time_usec: u64,
15606 #[doc = "Control output -1 .. 1"]
15607 pub roll_ailerons: f32,
15608 #[doc = "Control output -1 .. 1"]
15609 pub pitch_elevator: f32,
15610 #[doc = "Control output -1 .. 1"]
15611 pub yaw_rudder: f32,
15612 #[doc = "Throttle 0 .. 1"]
15613 pub throttle: f32,
15614 #[doc = "Aux 1, -1 .. 1"]
15615 pub aux1: f32,
15616 #[doc = "Aux 2, -1 .. 1"]
15617 pub aux2: f32,
15618 #[doc = "Aux 3, -1 .. 1"]
15619 pub aux3: f32,
15620 #[doc = "Aux 4, -1 .. 1"]
15621 pub aux4: f32,
15622 #[doc = "System mode."]
15623 pub mode: MavMode,
15624 #[doc = "Navigation mode (MAV_NAV_MODE)"]
15625 pub nav_mode: u8,
15626}
15627impl HIL_CONTROLS_DATA {
15628 pub const ENCODED_LEN: usize = 42usize;
15629 pub const DEFAULT: Self = Self {
15630 time_usec: 0_u64,
15631 roll_ailerons: 0.0_f32,
15632 pitch_elevator: 0.0_f32,
15633 yaw_rudder: 0.0_f32,
15634 throttle: 0.0_f32,
15635 aux1: 0.0_f32,
15636 aux2: 0.0_f32,
15637 aux3: 0.0_f32,
15638 aux4: 0.0_f32,
15639 mode: MavMode::DEFAULT,
15640 nav_mode: 0_u8,
15641 };
15642 #[cfg(feature = "arbitrary")]
15643 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
15644 use arbitrary::{Arbitrary, Unstructured};
15645 let mut buf = [0u8; 1024];
15646 rng.fill_bytes(&mut buf);
15647 let mut unstructured = Unstructured::new(&buf);
15648 Self::arbitrary(&mut unstructured).unwrap_or_default()
15649 }
15650}
15651impl Default for HIL_CONTROLS_DATA {
15652 fn default() -> Self {
15653 Self::DEFAULT.clone()
15654 }
15655}
15656impl MessageData for HIL_CONTROLS_DATA {
15657 type Message = MavMessage;
15658 const ID: u32 = 91u32;
15659 const NAME: &'static str = "HIL_CONTROLS";
15660 const EXTRA_CRC: u8 = 63u8;
15661 const ENCODED_LEN: usize = 42usize;
15662 fn deser(
15663 _version: MavlinkVersion,
15664 __input: &[u8],
15665 ) -> Result<Self, ::mavlink_core::error::ParserError> {
15666 let avail_len = __input.len();
15667 let mut payload_buf = [0; Self::ENCODED_LEN];
15668 let mut buf = if avail_len < Self::ENCODED_LEN {
15669 payload_buf[0..avail_len].copy_from_slice(__input);
15670 Bytes::new(&payload_buf)
15671 } else {
15672 Bytes::new(__input)
15673 };
15674 let mut __struct = Self::default();
15675 __struct.time_usec = buf.get_u64_le();
15676 __struct.roll_ailerons = buf.get_f32_le();
15677 __struct.pitch_elevator = buf.get_f32_le();
15678 __struct.yaw_rudder = buf.get_f32_le();
15679 __struct.throttle = buf.get_f32_le();
15680 __struct.aux1 = buf.get_f32_le();
15681 __struct.aux2 = buf.get_f32_le();
15682 __struct.aux3 = buf.get_f32_le();
15683 __struct.aux4 = buf.get_f32_le();
15684 let tmp = buf.get_u8();
15685 __struct.mode =
15686 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
15687 enum_type: "MavMode",
15688 value: tmp as u64,
15689 })?;
15690 __struct.nav_mode = buf.get_u8();
15691 Ok(__struct)
15692 }
15693 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
15694 let mut __tmp = BytesMut::new(bytes);
15695 #[allow(clippy::absurd_extreme_comparisons)]
15696 #[allow(unused_comparisons)]
15697 if __tmp.remaining() < Self::ENCODED_LEN {
15698 panic!(
15699 "buffer is too small (need {} bytes, but got {})",
15700 Self::ENCODED_LEN,
15701 __tmp.remaining(),
15702 )
15703 }
15704 __tmp.put_u64_le(self.time_usec);
15705 __tmp.put_f32_le(self.roll_ailerons);
15706 __tmp.put_f32_le(self.pitch_elevator);
15707 __tmp.put_f32_le(self.yaw_rudder);
15708 __tmp.put_f32_le(self.throttle);
15709 __tmp.put_f32_le(self.aux1);
15710 __tmp.put_f32_le(self.aux2);
15711 __tmp.put_f32_le(self.aux3);
15712 __tmp.put_f32_le(self.aux4);
15713 __tmp.put_u8(self.mode as u8);
15714 __tmp.put_u8(self.nav_mode);
15715 if matches!(version, MavlinkVersion::V2) {
15716 let len = __tmp.len();
15717 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
15718 } else {
15719 __tmp.len()
15720 }
15721 }
15722}
15723#[doc = "The global position, as returned by the Global Positioning System (GPS). This is NOT the global position estimate of the system, but rather a RAW sensor value. See message GLOBAL_POSITION_INT for the global position estimate."]
15724#[doc = ""]
15725#[doc = "ID: 113"]
15726#[derive(Debug, Clone, PartialEq)]
15727#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
15728#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
15729#[cfg_attr(feature = "ts", derive(TS))]
15730#[cfg_attr(feature = "ts", ts(export))]
15731pub struct HIL_GPS_DATA {
15732 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
15733 pub time_usec: u64,
15734 #[doc = "Latitude (WGS84)"]
15735 pub lat: i32,
15736 #[doc = "Longitude (WGS84)"]
15737 pub lon: i32,
15738 #[doc = "Altitude (MSL). Positive for up."]
15739 pub alt: i32,
15740 #[doc = "GPS HDOP horizontal dilution of position (unitless * 100). If unknown, set to: UINT16_MAX"]
15741 pub eph: u16,
15742 #[doc = "GPS VDOP vertical dilution of position (unitless * 100). If unknown, set to: UINT16_MAX"]
15743 pub epv: u16,
15744 #[doc = "GPS ground speed. If unknown, set to: UINT16_MAX"]
15745 pub vel: u16,
15746 #[doc = "GPS velocity in north direction in earth-fixed NED frame"]
15747 pub vn: i16,
15748 #[doc = "GPS velocity in east direction in earth-fixed NED frame"]
15749 pub ve: i16,
15750 #[doc = "GPS velocity in down direction in earth-fixed NED frame"]
15751 pub vd: i16,
15752 #[doc = "Course over ground (NOT heading, but direction of movement), 0.0..359.99 degrees. If unknown, set to: UINT16_MAX"]
15753 pub cog: u16,
15754 #[doc = "0-1: no fix, 2: 2D fix, 3: 3D fix. Some applications will not use the value of this field unless it is at least two, so always correctly fill in the fix."]
15755 pub fix_type: u8,
15756 #[doc = "Number of satellites visible. If unknown, set to UINT8_MAX"]
15757 pub satellites_visible: u8,
15758 #[doc = "GPS ID (zero indexed). Used for multiple GPS inputs"]
15759 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
15760 pub id: u8,
15761 #[doc = "Yaw of vehicle relative to Earth's North, zero means not available, use 36000 for north"]
15762 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
15763 pub yaw: u16,
15764}
15765impl HIL_GPS_DATA {
15766 pub const ENCODED_LEN: usize = 39usize;
15767 pub const DEFAULT: Self = Self {
15768 time_usec: 0_u64,
15769 lat: 0_i32,
15770 lon: 0_i32,
15771 alt: 0_i32,
15772 eph: 0_u16,
15773 epv: 0_u16,
15774 vel: 0_u16,
15775 vn: 0_i16,
15776 ve: 0_i16,
15777 vd: 0_i16,
15778 cog: 0_u16,
15779 fix_type: 0_u8,
15780 satellites_visible: 0_u8,
15781 id: 0_u8,
15782 yaw: 0_u16,
15783 };
15784 #[cfg(feature = "arbitrary")]
15785 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
15786 use arbitrary::{Arbitrary, Unstructured};
15787 let mut buf = [0u8; 1024];
15788 rng.fill_bytes(&mut buf);
15789 let mut unstructured = Unstructured::new(&buf);
15790 Self::arbitrary(&mut unstructured).unwrap_or_default()
15791 }
15792}
15793impl Default for HIL_GPS_DATA {
15794 fn default() -> Self {
15795 Self::DEFAULT.clone()
15796 }
15797}
15798impl MessageData for HIL_GPS_DATA {
15799 type Message = MavMessage;
15800 const ID: u32 = 113u32;
15801 const NAME: &'static str = "HIL_GPS";
15802 const EXTRA_CRC: u8 = 124u8;
15803 const ENCODED_LEN: usize = 39usize;
15804 fn deser(
15805 _version: MavlinkVersion,
15806 __input: &[u8],
15807 ) -> Result<Self, ::mavlink_core::error::ParserError> {
15808 let avail_len = __input.len();
15809 let mut payload_buf = [0; Self::ENCODED_LEN];
15810 let mut buf = if avail_len < Self::ENCODED_LEN {
15811 payload_buf[0..avail_len].copy_from_slice(__input);
15812 Bytes::new(&payload_buf)
15813 } else {
15814 Bytes::new(__input)
15815 };
15816 let mut __struct = Self::default();
15817 __struct.time_usec = buf.get_u64_le();
15818 __struct.lat = buf.get_i32_le();
15819 __struct.lon = buf.get_i32_le();
15820 __struct.alt = buf.get_i32_le();
15821 __struct.eph = buf.get_u16_le();
15822 __struct.epv = buf.get_u16_le();
15823 __struct.vel = buf.get_u16_le();
15824 __struct.vn = buf.get_i16_le();
15825 __struct.ve = buf.get_i16_le();
15826 __struct.vd = buf.get_i16_le();
15827 __struct.cog = buf.get_u16_le();
15828 __struct.fix_type = buf.get_u8();
15829 __struct.satellites_visible = buf.get_u8();
15830 __struct.id = buf.get_u8();
15831 __struct.yaw = buf.get_u16_le();
15832 Ok(__struct)
15833 }
15834 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
15835 let mut __tmp = BytesMut::new(bytes);
15836 #[allow(clippy::absurd_extreme_comparisons)]
15837 #[allow(unused_comparisons)]
15838 if __tmp.remaining() < Self::ENCODED_LEN {
15839 panic!(
15840 "buffer is too small (need {} bytes, but got {})",
15841 Self::ENCODED_LEN,
15842 __tmp.remaining(),
15843 )
15844 }
15845 __tmp.put_u64_le(self.time_usec);
15846 __tmp.put_i32_le(self.lat);
15847 __tmp.put_i32_le(self.lon);
15848 __tmp.put_i32_le(self.alt);
15849 __tmp.put_u16_le(self.eph);
15850 __tmp.put_u16_le(self.epv);
15851 __tmp.put_u16_le(self.vel);
15852 __tmp.put_i16_le(self.vn);
15853 __tmp.put_i16_le(self.ve);
15854 __tmp.put_i16_le(self.vd);
15855 __tmp.put_u16_le(self.cog);
15856 __tmp.put_u8(self.fix_type);
15857 __tmp.put_u8(self.satellites_visible);
15858 if matches!(version, MavlinkVersion::V2) {
15859 __tmp.put_u8(self.id);
15860 __tmp.put_u16_le(self.yaw);
15861 let len = __tmp.len();
15862 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
15863 } else {
15864 __tmp.len()
15865 }
15866 }
15867}
15868#[doc = "Simulated optical flow from a flow sensor (e.g. PX4FLOW or optical mouse sensor)."]
15869#[doc = ""]
15870#[doc = "ID: 114"]
15871#[derive(Debug, Clone, PartialEq)]
15872#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
15873#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
15874#[cfg_attr(feature = "ts", derive(TS))]
15875#[cfg_attr(feature = "ts", ts(export))]
15876pub struct HIL_OPTICAL_FLOW_DATA {
15877 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
15878 pub time_usec: u64,
15879 #[doc = "Integration time. Divide integrated_x and integrated_y by the integration time to obtain average flow. The integration time also indicates the."]
15880 pub integration_time_us: u32,
15881 #[doc = "Flow in radians around X axis (Sensor RH rotation about the X axis induces a positive flow. Sensor linear motion along the positive Y axis induces a negative flow.)"]
15882 pub integrated_x: f32,
15883 #[doc = "Flow in radians around Y axis (Sensor RH rotation about the Y axis induces a positive flow. Sensor linear motion along the positive X axis induces a positive flow.)"]
15884 pub integrated_y: f32,
15885 #[doc = "RH rotation around X axis"]
15886 pub integrated_xgyro: f32,
15887 #[doc = "RH rotation around Y axis"]
15888 pub integrated_ygyro: f32,
15889 #[doc = "RH rotation around Z axis"]
15890 pub integrated_zgyro: f32,
15891 #[doc = "Time since the distance was sampled."]
15892 pub time_delta_distance_us: u32,
15893 #[doc = "Distance to the center of the flow field. Positive value (including zero): distance known. Negative value: Unknown distance."]
15894 pub distance: f32,
15895 #[doc = "Temperature"]
15896 pub temperature: i16,
15897 #[doc = "Sensor ID"]
15898 pub sensor_id: u8,
15899 #[doc = "Optical flow quality / confidence. 0: no valid flow, 255: maximum quality"]
15900 pub quality: u8,
15901}
15902impl HIL_OPTICAL_FLOW_DATA {
15903 pub const ENCODED_LEN: usize = 44usize;
15904 pub const DEFAULT: Self = Self {
15905 time_usec: 0_u64,
15906 integration_time_us: 0_u32,
15907 integrated_x: 0.0_f32,
15908 integrated_y: 0.0_f32,
15909 integrated_xgyro: 0.0_f32,
15910 integrated_ygyro: 0.0_f32,
15911 integrated_zgyro: 0.0_f32,
15912 time_delta_distance_us: 0_u32,
15913 distance: 0.0_f32,
15914 temperature: 0_i16,
15915 sensor_id: 0_u8,
15916 quality: 0_u8,
15917 };
15918 #[cfg(feature = "arbitrary")]
15919 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
15920 use arbitrary::{Arbitrary, Unstructured};
15921 let mut buf = [0u8; 1024];
15922 rng.fill_bytes(&mut buf);
15923 let mut unstructured = Unstructured::new(&buf);
15924 Self::arbitrary(&mut unstructured).unwrap_or_default()
15925 }
15926}
15927impl Default for HIL_OPTICAL_FLOW_DATA {
15928 fn default() -> Self {
15929 Self::DEFAULT.clone()
15930 }
15931}
15932impl MessageData for HIL_OPTICAL_FLOW_DATA {
15933 type Message = MavMessage;
15934 const ID: u32 = 114u32;
15935 const NAME: &'static str = "HIL_OPTICAL_FLOW";
15936 const EXTRA_CRC: u8 = 237u8;
15937 const ENCODED_LEN: usize = 44usize;
15938 fn deser(
15939 _version: MavlinkVersion,
15940 __input: &[u8],
15941 ) -> Result<Self, ::mavlink_core::error::ParserError> {
15942 let avail_len = __input.len();
15943 let mut payload_buf = [0; Self::ENCODED_LEN];
15944 let mut buf = if avail_len < Self::ENCODED_LEN {
15945 payload_buf[0..avail_len].copy_from_slice(__input);
15946 Bytes::new(&payload_buf)
15947 } else {
15948 Bytes::new(__input)
15949 };
15950 let mut __struct = Self::default();
15951 __struct.time_usec = buf.get_u64_le();
15952 __struct.integration_time_us = buf.get_u32_le();
15953 __struct.integrated_x = buf.get_f32_le();
15954 __struct.integrated_y = buf.get_f32_le();
15955 __struct.integrated_xgyro = buf.get_f32_le();
15956 __struct.integrated_ygyro = buf.get_f32_le();
15957 __struct.integrated_zgyro = buf.get_f32_le();
15958 __struct.time_delta_distance_us = buf.get_u32_le();
15959 __struct.distance = buf.get_f32_le();
15960 __struct.temperature = buf.get_i16_le();
15961 __struct.sensor_id = buf.get_u8();
15962 __struct.quality = buf.get_u8();
15963 Ok(__struct)
15964 }
15965 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
15966 let mut __tmp = BytesMut::new(bytes);
15967 #[allow(clippy::absurd_extreme_comparisons)]
15968 #[allow(unused_comparisons)]
15969 if __tmp.remaining() < Self::ENCODED_LEN {
15970 panic!(
15971 "buffer is too small (need {} bytes, but got {})",
15972 Self::ENCODED_LEN,
15973 __tmp.remaining(),
15974 )
15975 }
15976 __tmp.put_u64_le(self.time_usec);
15977 __tmp.put_u32_le(self.integration_time_us);
15978 __tmp.put_f32_le(self.integrated_x);
15979 __tmp.put_f32_le(self.integrated_y);
15980 __tmp.put_f32_le(self.integrated_xgyro);
15981 __tmp.put_f32_le(self.integrated_ygyro);
15982 __tmp.put_f32_le(self.integrated_zgyro);
15983 __tmp.put_u32_le(self.time_delta_distance_us);
15984 __tmp.put_f32_le(self.distance);
15985 __tmp.put_i16_le(self.temperature);
15986 __tmp.put_u8(self.sensor_id);
15987 __tmp.put_u8(self.quality);
15988 if matches!(version, MavlinkVersion::V2) {
15989 let len = __tmp.len();
15990 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
15991 } else {
15992 __tmp.len()
15993 }
15994 }
15995}
15996#[doc = "Sent from simulation to autopilot. The RAW values of the RC channels received. The standard PPM modulation is as follows: 1000 microseconds: 0%, 2000 microseconds: 100%. Individual receivers/transmitters might violate this specification."]
15997#[doc = ""]
15998#[doc = "ID: 92"]
15999#[derive(Debug, Clone, PartialEq)]
16000#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
16001#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
16002#[cfg_attr(feature = "ts", derive(TS))]
16003#[cfg_attr(feature = "ts", ts(export))]
16004pub struct HIL_RC_INPUTS_RAW_DATA {
16005 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
16006 pub time_usec: u64,
16007 #[doc = "RC channel 1 value"]
16008 pub chan1_raw: u16,
16009 #[doc = "RC channel 2 value"]
16010 pub chan2_raw: u16,
16011 #[doc = "RC channel 3 value"]
16012 pub chan3_raw: u16,
16013 #[doc = "RC channel 4 value"]
16014 pub chan4_raw: u16,
16015 #[doc = "RC channel 5 value"]
16016 pub chan5_raw: u16,
16017 #[doc = "RC channel 6 value"]
16018 pub chan6_raw: u16,
16019 #[doc = "RC channel 7 value"]
16020 pub chan7_raw: u16,
16021 #[doc = "RC channel 8 value"]
16022 pub chan8_raw: u16,
16023 #[doc = "RC channel 9 value"]
16024 pub chan9_raw: u16,
16025 #[doc = "RC channel 10 value"]
16026 pub chan10_raw: u16,
16027 #[doc = "RC channel 11 value"]
16028 pub chan11_raw: u16,
16029 #[doc = "RC channel 12 value"]
16030 pub chan12_raw: u16,
16031 #[doc = "Receive signal strength indicator in device-dependent units/scale. Values: [0-254], UINT8_MAX: invalid/unknown."]
16032 pub rssi: u8,
16033}
16034impl HIL_RC_INPUTS_RAW_DATA {
16035 pub const ENCODED_LEN: usize = 33usize;
16036 pub const DEFAULT: Self = Self {
16037 time_usec: 0_u64,
16038 chan1_raw: 0_u16,
16039 chan2_raw: 0_u16,
16040 chan3_raw: 0_u16,
16041 chan4_raw: 0_u16,
16042 chan5_raw: 0_u16,
16043 chan6_raw: 0_u16,
16044 chan7_raw: 0_u16,
16045 chan8_raw: 0_u16,
16046 chan9_raw: 0_u16,
16047 chan10_raw: 0_u16,
16048 chan11_raw: 0_u16,
16049 chan12_raw: 0_u16,
16050 rssi: 0_u8,
16051 };
16052 #[cfg(feature = "arbitrary")]
16053 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
16054 use arbitrary::{Arbitrary, Unstructured};
16055 let mut buf = [0u8; 1024];
16056 rng.fill_bytes(&mut buf);
16057 let mut unstructured = Unstructured::new(&buf);
16058 Self::arbitrary(&mut unstructured).unwrap_or_default()
16059 }
16060}
16061impl Default for HIL_RC_INPUTS_RAW_DATA {
16062 fn default() -> Self {
16063 Self::DEFAULT.clone()
16064 }
16065}
16066impl MessageData for HIL_RC_INPUTS_RAW_DATA {
16067 type Message = MavMessage;
16068 const ID: u32 = 92u32;
16069 const NAME: &'static str = "HIL_RC_INPUTS_RAW";
16070 const EXTRA_CRC: u8 = 54u8;
16071 const ENCODED_LEN: usize = 33usize;
16072 fn deser(
16073 _version: MavlinkVersion,
16074 __input: &[u8],
16075 ) -> Result<Self, ::mavlink_core::error::ParserError> {
16076 let avail_len = __input.len();
16077 let mut payload_buf = [0; Self::ENCODED_LEN];
16078 let mut buf = if avail_len < Self::ENCODED_LEN {
16079 payload_buf[0..avail_len].copy_from_slice(__input);
16080 Bytes::new(&payload_buf)
16081 } else {
16082 Bytes::new(__input)
16083 };
16084 let mut __struct = Self::default();
16085 __struct.time_usec = buf.get_u64_le();
16086 __struct.chan1_raw = buf.get_u16_le();
16087 __struct.chan2_raw = buf.get_u16_le();
16088 __struct.chan3_raw = buf.get_u16_le();
16089 __struct.chan4_raw = buf.get_u16_le();
16090 __struct.chan5_raw = buf.get_u16_le();
16091 __struct.chan6_raw = buf.get_u16_le();
16092 __struct.chan7_raw = buf.get_u16_le();
16093 __struct.chan8_raw = buf.get_u16_le();
16094 __struct.chan9_raw = buf.get_u16_le();
16095 __struct.chan10_raw = buf.get_u16_le();
16096 __struct.chan11_raw = buf.get_u16_le();
16097 __struct.chan12_raw = buf.get_u16_le();
16098 __struct.rssi = buf.get_u8();
16099 Ok(__struct)
16100 }
16101 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
16102 let mut __tmp = BytesMut::new(bytes);
16103 #[allow(clippy::absurd_extreme_comparisons)]
16104 #[allow(unused_comparisons)]
16105 if __tmp.remaining() < Self::ENCODED_LEN {
16106 panic!(
16107 "buffer is too small (need {} bytes, but got {})",
16108 Self::ENCODED_LEN,
16109 __tmp.remaining(),
16110 )
16111 }
16112 __tmp.put_u64_le(self.time_usec);
16113 __tmp.put_u16_le(self.chan1_raw);
16114 __tmp.put_u16_le(self.chan2_raw);
16115 __tmp.put_u16_le(self.chan3_raw);
16116 __tmp.put_u16_le(self.chan4_raw);
16117 __tmp.put_u16_le(self.chan5_raw);
16118 __tmp.put_u16_le(self.chan6_raw);
16119 __tmp.put_u16_le(self.chan7_raw);
16120 __tmp.put_u16_le(self.chan8_raw);
16121 __tmp.put_u16_le(self.chan9_raw);
16122 __tmp.put_u16_le(self.chan10_raw);
16123 __tmp.put_u16_le(self.chan11_raw);
16124 __tmp.put_u16_le(self.chan12_raw);
16125 __tmp.put_u8(self.rssi);
16126 if matches!(version, MavlinkVersion::V2) {
16127 let len = __tmp.len();
16128 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
16129 } else {
16130 __tmp.len()
16131 }
16132 }
16133}
16134#[doc = "The IMU readings in SI units in NED body frame."]
16135#[doc = ""]
16136#[doc = "ID: 107"]
16137#[derive(Debug, Clone, PartialEq)]
16138#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
16139#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
16140#[cfg_attr(feature = "ts", derive(TS))]
16141#[cfg_attr(feature = "ts", ts(export))]
16142pub struct HIL_SENSOR_DATA {
16143 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
16144 pub time_usec: u64,
16145 #[doc = "X acceleration"]
16146 pub xacc: f32,
16147 #[doc = "Y acceleration"]
16148 pub yacc: f32,
16149 #[doc = "Z acceleration"]
16150 pub zacc: f32,
16151 #[doc = "Angular speed around X axis in body frame"]
16152 pub xgyro: f32,
16153 #[doc = "Angular speed around Y axis in body frame"]
16154 pub ygyro: f32,
16155 #[doc = "Angular speed around Z axis in body frame"]
16156 pub zgyro: f32,
16157 #[doc = "X Magnetic field"]
16158 pub xmag: f32,
16159 #[doc = "Y Magnetic field"]
16160 pub ymag: f32,
16161 #[doc = "Z Magnetic field"]
16162 pub zmag: f32,
16163 #[doc = "Absolute pressure"]
16164 pub abs_pressure: f32,
16165 #[doc = "Differential pressure (airspeed)"]
16166 pub diff_pressure: f32,
16167 #[doc = "Altitude calculated from pressure"]
16168 pub pressure_alt: f32,
16169 #[doc = "Temperature"]
16170 pub temperature: f32,
16171 #[doc = "Bitmap for fields that have updated since last message"]
16172 pub fields_updated: HilSensorUpdatedFlags,
16173 #[doc = "Sensor ID (zero indexed). Used for multiple sensor inputs"]
16174 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
16175 pub id: u8,
16176}
16177impl HIL_SENSOR_DATA {
16178 pub const ENCODED_LEN: usize = 65usize;
16179 pub const DEFAULT: Self = Self {
16180 time_usec: 0_u64,
16181 xacc: 0.0_f32,
16182 yacc: 0.0_f32,
16183 zacc: 0.0_f32,
16184 xgyro: 0.0_f32,
16185 ygyro: 0.0_f32,
16186 zgyro: 0.0_f32,
16187 xmag: 0.0_f32,
16188 ymag: 0.0_f32,
16189 zmag: 0.0_f32,
16190 abs_pressure: 0.0_f32,
16191 diff_pressure: 0.0_f32,
16192 pressure_alt: 0.0_f32,
16193 temperature: 0.0_f32,
16194 fields_updated: HilSensorUpdatedFlags::DEFAULT,
16195 id: 0_u8,
16196 };
16197 #[cfg(feature = "arbitrary")]
16198 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
16199 use arbitrary::{Arbitrary, Unstructured};
16200 let mut buf = [0u8; 1024];
16201 rng.fill_bytes(&mut buf);
16202 let mut unstructured = Unstructured::new(&buf);
16203 Self::arbitrary(&mut unstructured).unwrap_or_default()
16204 }
16205}
16206impl Default for HIL_SENSOR_DATA {
16207 fn default() -> Self {
16208 Self::DEFAULT.clone()
16209 }
16210}
16211impl MessageData for HIL_SENSOR_DATA {
16212 type Message = MavMessage;
16213 const ID: u32 = 107u32;
16214 const NAME: &'static str = "HIL_SENSOR";
16215 const EXTRA_CRC: u8 = 108u8;
16216 const ENCODED_LEN: usize = 65usize;
16217 fn deser(
16218 _version: MavlinkVersion,
16219 __input: &[u8],
16220 ) -> Result<Self, ::mavlink_core::error::ParserError> {
16221 let avail_len = __input.len();
16222 let mut payload_buf = [0; Self::ENCODED_LEN];
16223 let mut buf = if avail_len < Self::ENCODED_LEN {
16224 payload_buf[0..avail_len].copy_from_slice(__input);
16225 Bytes::new(&payload_buf)
16226 } else {
16227 Bytes::new(__input)
16228 };
16229 let mut __struct = Self::default();
16230 __struct.time_usec = buf.get_u64_le();
16231 __struct.xacc = buf.get_f32_le();
16232 __struct.yacc = buf.get_f32_le();
16233 __struct.zacc = buf.get_f32_le();
16234 __struct.xgyro = buf.get_f32_le();
16235 __struct.ygyro = buf.get_f32_le();
16236 __struct.zgyro = buf.get_f32_le();
16237 __struct.xmag = buf.get_f32_le();
16238 __struct.ymag = buf.get_f32_le();
16239 __struct.zmag = buf.get_f32_le();
16240 __struct.abs_pressure = buf.get_f32_le();
16241 __struct.diff_pressure = buf.get_f32_le();
16242 __struct.pressure_alt = buf.get_f32_le();
16243 __struct.temperature = buf.get_f32_le();
16244 let tmp = buf.get_u32_le();
16245 __struct.fields_updated = HilSensorUpdatedFlags::from_bits(
16246 tmp as <HilSensorUpdatedFlags as Flags>::Bits,
16247 )
16248 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
16249 flag_type: "HilSensorUpdatedFlags",
16250 value: tmp as u64,
16251 })?;
16252 __struct.id = buf.get_u8();
16253 Ok(__struct)
16254 }
16255 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
16256 let mut __tmp = BytesMut::new(bytes);
16257 #[allow(clippy::absurd_extreme_comparisons)]
16258 #[allow(unused_comparisons)]
16259 if __tmp.remaining() < Self::ENCODED_LEN {
16260 panic!(
16261 "buffer is too small (need {} bytes, but got {})",
16262 Self::ENCODED_LEN,
16263 __tmp.remaining(),
16264 )
16265 }
16266 __tmp.put_u64_le(self.time_usec);
16267 __tmp.put_f32_le(self.xacc);
16268 __tmp.put_f32_le(self.yacc);
16269 __tmp.put_f32_le(self.zacc);
16270 __tmp.put_f32_le(self.xgyro);
16271 __tmp.put_f32_le(self.ygyro);
16272 __tmp.put_f32_le(self.zgyro);
16273 __tmp.put_f32_le(self.xmag);
16274 __tmp.put_f32_le(self.ymag);
16275 __tmp.put_f32_le(self.zmag);
16276 __tmp.put_f32_le(self.abs_pressure);
16277 __tmp.put_f32_le(self.diff_pressure);
16278 __tmp.put_f32_le(self.pressure_alt);
16279 __tmp.put_f32_le(self.temperature);
16280 __tmp.put_u32_le(self.fields_updated.bits() as u32);
16281 if matches!(version, MavlinkVersion::V2) {
16282 __tmp.put_u8(self.id);
16283 let len = __tmp.len();
16284 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
16285 } else {
16286 __tmp.len()
16287 }
16288 }
16289}
16290#[deprecated = "Suffers from missing airspeed fields and singularities due to Euler angles. See `HIL_STATE_QUATERNION` (Deprecated since 2013-07)"]
16291#[doc = "Sent from simulation to autopilot. This packet is useful for high throughput applications such as hardware in the loop simulations."]
16292#[doc = ""]
16293#[doc = "ID: 90"]
16294#[derive(Debug, Clone, PartialEq)]
16295#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
16296#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
16297#[cfg_attr(feature = "ts", derive(TS))]
16298#[cfg_attr(feature = "ts", ts(export))]
16299pub struct HIL_STATE_DATA {
16300 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
16301 pub time_usec: u64,
16302 #[doc = "Roll angle"]
16303 pub roll: f32,
16304 #[doc = "Pitch angle"]
16305 pub pitch: f32,
16306 #[doc = "Yaw angle"]
16307 pub yaw: f32,
16308 #[doc = "Body frame roll / phi angular speed"]
16309 pub rollspeed: f32,
16310 #[doc = "Body frame pitch / theta angular speed"]
16311 pub pitchspeed: f32,
16312 #[doc = "Body frame yaw / psi angular speed"]
16313 pub yawspeed: f32,
16314 #[doc = "Latitude"]
16315 pub lat: i32,
16316 #[doc = "Longitude"]
16317 pub lon: i32,
16318 #[doc = "Altitude"]
16319 pub alt: i32,
16320 #[doc = "Ground X Speed (Latitude)"]
16321 pub vx: i16,
16322 #[doc = "Ground Y Speed (Longitude)"]
16323 pub vy: i16,
16324 #[doc = "Ground Z Speed (Altitude)"]
16325 pub vz: i16,
16326 #[doc = "X acceleration"]
16327 pub xacc: i16,
16328 #[doc = "Y acceleration"]
16329 pub yacc: i16,
16330 #[doc = "Z acceleration"]
16331 pub zacc: i16,
16332}
16333impl HIL_STATE_DATA {
16334 pub const ENCODED_LEN: usize = 56usize;
16335 pub const DEFAULT: Self = Self {
16336 time_usec: 0_u64,
16337 roll: 0.0_f32,
16338 pitch: 0.0_f32,
16339 yaw: 0.0_f32,
16340 rollspeed: 0.0_f32,
16341 pitchspeed: 0.0_f32,
16342 yawspeed: 0.0_f32,
16343 lat: 0_i32,
16344 lon: 0_i32,
16345 alt: 0_i32,
16346 vx: 0_i16,
16347 vy: 0_i16,
16348 vz: 0_i16,
16349 xacc: 0_i16,
16350 yacc: 0_i16,
16351 zacc: 0_i16,
16352 };
16353 #[cfg(feature = "arbitrary")]
16354 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
16355 use arbitrary::{Arbitrary, Unstructured};
16356 let mut buf = [0u8; 1024];
16357 rng.fill_bytes(&mut buf);
16358 let mut unstructured = Unstructured::new(&buf);
16359 Self::arbitrary(&mut unstructured).unwrap_or_default()
16360 }
16361}
16362impl Default for HIL_STATE_DATA {
16363 fn default() -> Self {
16364 Self::DEFAULT.clone()
16365 }
16366}
16367impl MessageData for HIL_STATE_DATA {
16368 type Message = MavMessage;
16369 const ID: u32 = 90u32;
16370 const NAME: &'static str = "HIL_STATE";
16371 const EXTRA_CRC: u8 = 183u8;
16372 const ENCODED_LEN: usize = 56usize;
16373 fn deser(
16374 _version: MavlinkVersion,
16375 __input: &[u8],
16376 ) -> Result<Self, ::mavlink_core::error::ParserError> {
16377 let avail_len = __input.len();
16378 let mut payload_buf = [0; Self::ENCODED_LEN];
16379 let mut buf = if avail_len < Self::ENCODED_LEN {
16380 payload_buf[0..avail_len].copy_from_slice(__input);
16381 Bytes::new(&payload_buf)
16382 } else {
16383 Bytes::new(__input)
16384 };
16385 let mut __struct = Self::default();
16386 __struct.time_usec = buf.get_u64_le();
16387 __struct.roll = buf.get_f32_le();
16388 __struct.pitch = buf.get_f32_le();
16389 __struct.yaw = buf.get_f32_le();
16390 __struct.rollspeed = buf.get_f32_le();
16391 __struct.pitchspeed = buf.get_f32_le();
16392 __struct.yawspeed = buf.get_f32_le();
16393 __struct.lat = buf.get_i32_le();
16394 __struct.lon = buf.get_i32_le();
16395 __struct.alt = buf.get_i32_le();
16396 __struct.vx = buf.get_i16_le();
16397 __struct.vy = buf.get_i16_le();
16398 __struct.vz = buf.get_i16_le();
16399 __struct.xacc = buf.get_i16_le();
16400 __struct.yacc = buf.get_i16_le();
16401 __struct.zacc = buf.get_i16_le();
16402 Ok(__struct)
16403 }
16404 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
16405 let mut __tmp = BytesMut::new(bytes);
16406 #[allow(clippy::absurd_extreme_comparisons)]
16407 #[allow(unused_comparisons)]
16408 if __tmp.remaining() < Self::ENCODED_LEN {
16409 panic!(
16410 "buffer is too small (need {} bytes, but got {})",
16411 Self::ENCODED_LEN,
16412 __tmp.remaining(),
16413 )
16414 }
16415 __tmp.put_u64_le(self.time_usec);
16416 __tmp.put_f32_le(self.roll);
16417 __tmp.put_f32_le(self.pitch);
16418 __tmp.put_f32_le(self.yaw);
16419 __tmp.put_f32_le(self.rollspeed);
16420 __tmp.put_f32_le(self.pitchspeed);
16421 __tmp.put_f32_le(self.yawspeed);
16422 __tmp.put_i32_le(self.lat);
16423 __tmp.put_i32_le(self.lon);
16424 __tmp.put_i32_le(self.alt);
16425 __tmp.put_i16_le(self.vx);
16426 __tmp.put_i16_le(self.vy);
16427 __tmp.put_i16_le(self.vz);
16428 __tmp.put_i16_le(self.xacc);
16429 __tmp.put_i16_le(self.yacc);
16430 __tmp.put_i16_le(self.zacc);
16431 if matches!(version, MavlinkVersion::V2) {
16432 let len = __tmp.len();
16433 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
16434 } else {
16435 __tmp.len()
16436 }
16437 }
16438}
16439#[doc = "Sent from simulation to autopilot, avoids in contrast to HIL_STATE singularities. This packet is useful for high throughput applications such as hardware in the loop simulations."]
16440#[doc = ""]
16441#[doc = "ID: 115"]
16442#[derive(Debug, Clone, PartialEq)]
16443#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
16444#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
16445#[cfg_attr(feature = "ts", derive(TS))]
16446#[cfg_attr(feature = "ts", ts(export))]
16447pub struct HIL_STATE_QUATERNION_DATA {
16448 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
16449 pub time_usec: u64,
16450 #[doc = "Vehicle attitude expressed as normalized quaternion in w, x, y, z order (with 1 0 0 0 being the null-rotation)"]
16451 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
16452 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
16453 pub attitude_quaternion: [f32; 4],
16454 #[doc = "Body frame roll / phi angular speed"]
16455 pub rollspeed: f32,
16456 #[doc = "Body frame pitch / theta angular speed"]
16457 pub pitchspeed: f32,
16458 #[doc = "Body frame yaw / psi angular speed"]
16459 pub yawspeed: f32,
16460 #[doc = "Latitude"]
16461 pub lat: i32,
16462 #[doc = "Longitude"]
16463 pub lon: i32,
16464 #[doc = "Altitude"]
16465 pub alt: i32,
16466 #[doc = "Ground X Speed (Latitude)"]
16467 pub vx: i16,
16468 #[doc = "Ground Y Speed (Longitude)"]
16469 pub vy: i16,
16470 #[doc = "Ground Z Speed (Altitude)"]
16471 pub vz: i16,
16472 #[doc = "Indicated airspeed"]
16473 pub ind_airspeed: u16,
16474 #[doc = "True airspeed"]
16475 pub true_airspeed: u16,
16476 #[doc = "X acceleration"]
16477 pub xacc: i16,
16478 #[doc = "Y acceleration"]
16479 pub yacc: i16,
16480 #[doc = "Z acceleration"]
16481 pub zacc: i16,
16482}
16483impl HIL_STATE_QUATERNION_DATA {
16484 pub const ENCODED_LEN: usize = 64usize;
16485 pub const DEFAULT: Self = Self {
16486 time_usec: 0_u64,
16487 attitude_quaternion: [0.0_f32; 4usize],
16488 rollspeed: 0.0_f32,
16489 pitchspeed: 0.0_f32,
16490 yawspeed: 0.0_f32,
16491 lat: 0_i32,
16492 lon: 0_i32,
16493 alt: 0_i32,
16494 vx: 0_i16,
16495 vy: 0_i16,
16496 vz: 0_i16,
16497 ind_airspeed: 0_u16,
16498 true_airspeed: 0_u16,
16499 xacc: 0_i16,
16500 yacc: 0_i16,
16501 zacc: 0_i16,
16502 };
16503 #[cfg(feature = "arbitrary")]
16504 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
16505 use arbitrary::{Arbitrary, Unstructured};
16506 let mut buf = [0u8; 1024];
16507 rng.fill_bytes(&mut buf);
16508 let mut unstructured = Unstructured::new(&buf);
16509 Self::arbitrary(&mut unstructured).unwrap_or_default()
16510 }
16511}
16512impl Default for HIL_STATE_QUATERNION_DATA {
16513 fn default() -> Self {
16514 Self::DEFAULT.clone()
16515 }
16516}
16517impl MessageData for HIL_STATE_QUATERNION_DATA {
16518 type Message = MavMessage;
16519 const ID: u32 = 115u32;
16520 const NAME: &'static str = "HIL_STATE_QUATERNION";
16521 const EXTRA_CRC: u8 = 4u8;
16522 const ENCODED_LEN: usize = 64usize;
16523 fn deser(
16524 _version: MavlinkVersion,
16525 __input: &[u8],
16526 ) -> Result<Self, ::mavlink_core::error::ParserError> {
16527 let avail_len = __input.len();
16528 let mut payload_buf = [0; Self::ENCODED_LEN];
16529 let mut buf = if avail_len < Self::ENCODED_LEN {
16530 payload_buf[0..avail_len].copy_from_slice(__input);
16531 Bytes::new(&payload_buf)
16532 } else {
16533 Bytes::new(__input)
16534 };
16535 let mut __struct = Self::default();
16536 __struct.time_usec = buf.get_u64_le();
16537 for v in &mut __struct.attitude_quaternion {
16538 let val = buf.get_f32_le();
16539 *v = val;
16540 }
16541 __struct.rollspeed = buf.get_f32_le();
16542 __struct.pitchspeed = buf.get_f32_le();
16543 __struct.yawspeed = buf.get_f32_le();
16544 __struct.lat = buf.get_i32_le();
16545 __struct.lon = buf.get_i32_le();
16546 __struct.alt = buf.get_i32_le();
16547 __struct.vx = buf.get_i16_le();
16548 __struct.vy = buf.get_i16_le();
16549 __struct.vz = buf.get_i16_le();
16550 __struct.ind_airspeed = buf.get_u16_le();
16551 __struct.true_airspeed = buf.get_u16_le();
16552 __struct.xacc = buf.get_i16_le();
16553 __struct.yacc = buf.get_i16_le();
16554 __struct.zacc = buf.get_i16_le();
16555 Ok(__struct)
16556 }
16557 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
16558 let mut __tmp = BytesMut::new(bytes);
16559 #[allow(clippy::absurd_extreme_comparisons)]
16560 #[allow(unused_comparisons)]
16561 if __tmp.remaining() < Self::ENCODED_LEN {
16562 panic!(
16563 "buffer is too small (need {} bytes, but got {})",
16564 Self::ENCODED_LEN,
16565 __tmp.remaining(),
16566 )
16567 }
16568 __tmp.put_u64_le(self.time_usec);
16569 for val in &self.attitude_quaternion {
16570 __tmp.put_f32_le(*val);
16571 }
16572 __tmp.put_f32_le(self.rollspeed);
16573 __tmp.put_f32_le(self.pitchspeed);
16574 __tmp.put_f32_le(self.yawspeed);
16575 __tmp.put_i32_le(self.lat);
16576 __tmp.put_i32_le(self.lon);
16577 __tmp.put_i32_le(self.alt);
16578 __tmp.put_i16_le(self.vx);
16579 __tmp.put_i16_le(self.vy);
16580 __tmp.put_i16_le(self.vz);
16581 __tmp.put_u16_le(self.ind_airspeed);
16582 __tmp.put_u16_le(self.true_airspeed);
16583 __tmp.put_i16_le(self.xacc);
16584 __tmp.put_i16_le(self.yacc);
16585 __tmp.put_i16_le(self.zacc);
16586 if matches!(version, MavlinkVersion::V2) {
16587 let len = __tmp.len();
16588 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
16589 } else {
16590 __tmp.len()
16591 }
16592 }
16593}
16594#[doc = "Contains the home position. \tThe home position is the default position that the system will return to and land on. \tThe position must be set automatically by the system during the takeoff, and may also be explicitly set using MAV_CMD_DO_SET_HOME. \tThe global and local positions encode the position in the respective coordinate frames, while the q parameter encodes the orientation of the surface. \tUnder normal conditions it describes the heading and terrain slope, which can be used by the aircraft to adjust the approach. \tThe approach 3D vector describes the point to which the system should fly in normal flight mode and then perform a landing sequence along the vector. Note: this message can be requested by sending the MAV_CMD_REQUEST_MESSAGE with param1=242 (or the deprecated MAV_CMD_GET_HOME_POSITION command)."]
16595#[doc = ""]
16596#[doc = "ID: 242"]
16597#[derive(Debug, Clone, PartialEq)]
16598#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
16599#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
16600#[cfg_attr(feature = "ts", derive(TS))]
16601#[cfg_attr(feature = "ts", ts(export))]
16602pub struct HOME_POSITION_DATA {
16603 #[doc = "Latitude (WGS84)"]
16604 pub latitude: i32,
16605 #[doc = "Longitude (WGS84)"]
16606 pub longitude: i32,
16607 #[doc = "Altitude (MSL). Positive for up."]
16608 pub altitude: i32,
16609 #[doc = "Local X position of this position in the local coordinate frame (NED)"]
16610 pub x: f32,
16611 #[doc = "Local Y position of this position in the local coordinate frame (NED)"]
16612 pub y: f32,
16613 #[doc = "Local Z position of this position in the local coordinate frame (NED: positive \"down\")"]
16614 pub z: f32,
16615 #[doc = "Quaternion indicating world-to-surface-normal and heading transformation of the takeoff position. Used to indicate the heading and slope of the ground. All fields should be set to NaN if an accurate quaternion for both heading and surface slope cannot be supplied."]
16616 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
16617 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
16618 pub q: [f32; 4],
16619 #[doc = "Local X position of the end of the approach vector. Multicopters should set this position based on their takeoff path. Grass-landing fixed wing aircraft should set it the same way as multicopters. Runway-landing fixed wing aircraft should set it to the opposite direction of the takeoff, assuming the takeoff happened from the threshold / touchdown zone."]
16620 pub approach_x: f32,
16621 #[doc = "Local Y position of the end of the approach vector. Multicopters should set this position based on their takeoff path. Grass-landing fixed wing aircraft should set it the same way as multicopters. Runway-landing fixed wing aircraft should set it to the opposite direction of the takeoff, assuming the takeoff happened from the threshold / touchdown zone."]
16622 pub approach_y: f32,
16623 #[doc = "Local Z position of the end of the approach vector. Multicopters should set this position based on their takeoff path. Grass-landing fixed wing aircraft should set it the same way as multicopters. Runway-landing fixed wing aircraft should set it to the opposite direction of the takeoff, assuming the takeoff happened from the threshold / touchdown zone."]
16624 pub approach_z: f32,
16625 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
16626 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
16627 pub time_usec: u64,
16628}
16629impl HOME_POSITION_DATA {
16630 pub const ENCODED_LEN: usize = 60usize;
16631 pub const DEFAULT: Self = Self {
16632 latitude: 0_i32,
16633 longitude: 0_i32,
16634 altitude: 0_i32,
16635 x: 0.0_f32,
16636 y: 0.0_f32,
16637 z: 0.0_f32,
16638 q: [0.0_f32; 4usize],
16639 approach_x: 0.0_f32,
16640 approach_y: 0.0_f32,
16641 approach_z: 0.0_f32,
16642 time_usec: 0_u64,
16643 };
16644 #[cfg(feature = "arbitrary")]
16645 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
16646 use arbitrary::{Arbitrary, Unstructured};
16647 let mut buf = [0u8; 1024];
16648 rng.fill_bytes(&mut buf);
16649 let mut unstructured = Unstructured::new(&buf);
16650 Self::arbitrary(&mut unstructured).unwrap_or_default()
16651 }
16652}
16653impl Default for HOME_POSITION_DATA {
16654 fn default() -> Self {
16655 Self::DEFAULT.clone()
16656 }
16657}
16658impl MessageData for HOME_POSITION_DATA {
16659 type Message = MavMessage;
16660 const ID: u32 = 242u32;
16661 const NAME: &'static str = "HOME_POSITION";
16662 const EXTRA_CRC: u8 = 104u8;
16663 const ENCODED_LEN: usize = 60usize;
16664 fn deser(
16665 _version: MavlinkVersion,
16666 __input: &[u8],
16667 ) -> Result<Self, ::mavlink_core::error::ParserError> {
16668 let avail_len = __input.len();
16669 let mut payload_buf = [0; Self::ENCODED_LEN];
16670 let mut buf = if avail_len < Self::ENCODED_LEN {
16671 payload_buf[0..avail_len].copy_from_slice(__input);
16672 Bytes::new(&payload_buf)
16673 } else {
16674 Bytes::new(__input)
16675 };
16676 let mut __struct = Self::default();
16677 __struct.latitude = buf.get_i32_le();
16678 __struct.longitude = buf.get_i32_le();
16679 __struct.altitude = buf.get_i32_le();
16680 __struct.x = buf.get_f32_le();
16681 __struct.y = buf.get_f32_le();
16682 __struct.z = buf.get_f32_le();
16683 for v in &mut __struct.q {
16684 let val = buf.get_f32_le();
16685 *v = val;
16686 }
16687 __struct.approach_x = buf.get_f32_le();
16688 __struct.approach_y = buf.get_f32_le();
16689 __struct.approach_z = buf.get_f32_le();
16690 __struct.time_usec = buf.get_u64_le();
16691 Ok(__struct)
16692 }
16693 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
16694 let mut __tmp = BytesMut::new(bytes);
16695 #[allow(clippy::absurd_extreme_comparisons)]
16696 #[allow(unused_comparisons)]
16697 if __tmp.remaining() < Self::ENCODED_LEN {
16698 panic!(
16699 "buffer is too small (need {} bytes, but got {})",
16700 Self::ENCODED_LEN,
16701 __tmp.remaining(),
16702 )
16703 }
16704 __tmp.put_i32_le(self.latitude);
16705 __tmp.put_i32_le(self.longitude);
16706 __tmp.put_i32_le(self.altitude);
16707 __tmp.put_f32_le(self.x);
16708 __tmp.put_f32_le(self.y);
16709 __tmp.put_f32_le(self.z);
16710 for val in &self.q {
16711 __tmp.put_f32_le(*val);
16712 }
16713 __tmp.put_f32_le(self.approach_x);
16714 __tmp.put_f32_le(self.approach_y);
16715 __tmp.put_f32_le(self.approach_z);
16716 if matches!(version, MavlinkVersion::V2) {
16717 __tmp.put_u64_le(self.time_usec);
16718 let len = __tmp.len();
16719 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
16720 } else {
16721 __tmp.len()
16722 }
16723 }
16724}
16725#[doc = "Temperature and humidity from hygrometer."]
16726#[doc = ""]
16727#[doc = "ID: 12920"]
16728#[derive(Debug, Clone, PartialEq)]
16729#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
16730#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
16731#[cfg_attr(feature = "ts", derive(TS))]
16732#[cfg_attr(feature = "ts", ts(export))]
16733pub struct HYGROMETER_SENSOR_DATA {
16734 #[doc = "Temperature"]
16735 pub temperature: i16,
16736 #[doc = "Humidity"]
16737 pub humidity: u16,
16738 #[doc = "Hygrometer ID"]
16739 pub id: u8,
16740}
16741impl HYGROMETER_SENSOR_DATA {
16742 pub const ENCODED_LEN: usize = 5usize;
16743 pub const DEFAULT: Self = Self {
16744 temperature: 0_i16,
16745 humidity: 0_u16,
16746 id: 0_u8,
16747 };
16748 #[cfg(feature = "arbitrary")]
16749 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
16750 use arbitrary::{Arbitrary, Unstructured};
16751 let mut buf = [0u8; 1024];
16752 rng.fill_bytes(&mut buf);
16753 let mut unstructured = Unstructured::new(&buf);
16754 Self::arbitrary(&mut unstructured).unwrap_or_default()
16755 }
16756}
16757impl Default for HYGROMETER_SENSOR_DATA {
16758 fn default() -> Self {
16759 Self::DEFAULT.clone()
16760 }
16761}
16762impl MessageData for HYGROMETER_SENSOR_DATA {
16763 type Message = MavMessage;
16764 const ID: u32 = 12920u32;
16765 const NAME: &'static str = "HYGROMETER_SENSOR";
16766 const EXTRA_CRC: u8 = 20u8;
16767 const ENCODED_LEN: usize = 5usize;
16768 fn deser(
16769 _version: MavlinkVersion,
16770 __input: &[u8],
16771 ) -> Result<Self, ::mavlink_core::error::ParserError> {
16772 let avail_len = __input.len();
16773 let mut payload_buf = [0; Self::ENCODED_LEN];
16774 let mut buf = if avail_len < Self::ENCODED_LEN {
16775 payload_buf[0..avail_len].copy_from_slice(__input);
16776 Bytes::new(&payload_buf)
16777 } else {
16778 Bytes::new(__input)
16779 };
16780 let mut __struct = Self::default();
16781 __struct.temperature = buf.get_i16_le();
16782 __struct.humidity = buf.get_u16_le();
16783 __struct.id = buf.get_u8();
16784 Ok(__struct)
16785 }
16786 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
16787 let mut __tmp = BytesMut::new(bytes);
16788 #[allow(clippy::absurd_extreme_comparisons)]
16789 #[allow(unused_comparisons)]
16790 if __tmp.remaining() < Self::ENCODED_LEN {
16791 panic!(
16792 "buffer is too small (need {} bytes, but got {})",
16793 Self::ENCODED_LEN,
16794 __tmp.remaining(),
16795 )
16796 }
16797 __tmp.put_i16_le(self.temperature);
16798 __tmp.put_u16_le(self.humidity);
16799 __tmp.put_u8(self.id);
16800 if matches!(version, MavlinkVersion::V2) {
16801 let len = __tmp.len();
16802 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
16803 } else {
16804 __tmp.len()
16805 }
16806 }
16807}
16808#[doc = "Illuminator status."]
16809#[doc = ""]
16810#[doc = "ID: 440"]
16811#[derive(Debug, Clone, PartialEq)]
16812#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
16813#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
16814#[cfg_attr(feature = "ts", derive(TS))]
16815#[cfg_attr(feature = "ts", ts(export))]
16816pub struct ILLUMINATOR_STATUS_DATA {
16817 #[doc = "Time since the start-up of the illuminator in ms"]
16818 pub uptime_ms: u32,
16819 #[doc = "Errors"]
16820 pub error_status: IlluminatorErrorFlags,
16821 #[doc = "Illuminator brightness"]
16822 pub brightness: f32,
16823 #[doc = "Illuminator strobing period in seconds"]
16824 pub strobe_period: f32,
16825 #[doc = "Illuminator strobing duty cycle"]
16826 pub strobe_duty_cycle: f32,
16827 #[doc = "Temperature in Celsius"]
16828 pub temp_c: f32,
16829 #[doc = "Minimum strobing period in seconds"]
16830 pub min_strobe_period: f32,
16831 #[doc = "Maximum strobing period in seconds"]
16832 pub max_strobe_period: f32,
16833 #[doc = "0: Illuminators OFF, 1: Illuminators ON"]
16834 pub enable: u8,
16835 #[doc = "Supported illuminator modes"]
16836 pub mode_bitmask: IlluminatorMode,
16837 #[doc = "Illuminator mode"]
16838 pub mode: IlluminatorMode,
16839}
16840impl ILLUMINATOR_STATUS_DATA {
16841 pub const ENCODED_LEN: usize = 35usize;
16842 pub const DEFAULT: Self = Self {
16843 uptime_ms: 0_u32,
16844 error_status: IlluminatorErrorFlags::DEFAULT,
16845 brightness: 0.0_f32,
16846 strobe_period: 0.0_f32,
16847 strobe_duty_cycle: 0.0_f32,
16848 temp_c: 0.0_f32,
16849 min_strobe_period: 0.0_f32,
16850 max_strobe_period: 0.0_f32,
16851 enable: 0_u8,
16852 mode_bitmask: IlluminatorMode::DEFAULT,
16853 mode: IlluminatorMode::DEFAULT,
16854 };
16855 #[cfg(feature = "arbitrary")]
16856 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
16857 use arbitrary::{Arbitrary, Unstructured};
16858 let mut buf = [0u8; 1024];
16859 rng.fill_bytes(&mut buf);
16860 let mut unstructured = Unstructured::new(&buf);
16861 Self::arbitrary(&mut unstructured).unwrap_or_default()
16862 }
16863}
16864impl Default for ILLUMINATOR_STATUS_DATA {
16865 fn default() -> Self {
16866 Self::DEFAULT.clone()
16867 }
16868}
16869impl MessageData for ILLUMINATOR_STATUS_DATA {
16870 type Message = MavMessage;
16871 const ID: u32 = 440u32;
16872 const NAME: &'static str = "ILLUMINATOR_STATUS";
16873 const EXTRA_CRC: u8 = 66u8;
16874 const ENCODED_LEN: usize = 35usize;
16875 fn deser(
16876 _version: MavlinkVersion,
16877 __input: &[u8],
16878 ) -> Result<Self, ::mavlink_core::error::ParserError> {
16879 let avail_len = __input.len();
16880 let mut payload_buf = [0; Self::ENCODED_LEN];
16881 let mut buf = if avail_len < Self::ENCODED_LEN {
16882 payload_buf[0..avail_len].copy_from_slice(__input);
16883 Bytes::new(&payload_buf)
16884 } else {
16885 Bytes::new(__input)
16886 };
16887 let mut __struct = Self::default();
16888 __struct.uptime_ms = buf.get_u32_le();
16889 let tmp = buf.get_u32_le();
16890 __struct.error_status = IlluminatorErrorFlags::from_bits(
16891 tmp as <IlluminatorErrorFlags as Flags>::Bits,
16892 )
16893 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
16894 flag_type: "IlluminatorErrorFlags",
16895 value: tmp as u64,
16896 })?;
16897 __struct.brightness = buf.get_f32_le();
16898 __struct.strobe_period = buf.get_f32_le();
16899 __struct.strobe_duty_cycle = buf.get_f32_le();
16900 __struct.temp_c = buf.get_f32_le();
16901 __struct.min_strobe_period = buf.get_f32_le();
16902 __struct.max_strobe_period = buf.get_f32_le();
16903 __struct.enable = buf.get_u8();
16904 let tmp = buf.get_u8();
16905 __struct.mode_bitmask =
16906 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
16907 enum_type: "IlluminatorMode",
16908 value: tmp as u64,
16909 })?;
16910 let tmp = buf.get_u8();
16911 __struct.mode =
16912 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
16913 enum_type: "IlluminatorMode",
16914 value: tmp as u64,
16915 })?;
16916 Ok(__struct)
16917 }
16918 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
16919 let mut __tmp = BytesMut::new(bytes);
16920 #[allow(clippy::absurd_extreme_comparisons)]
16921 #[allow(unused_comparisons)]
16922 if __tmp.remaining() < Self::ENCODED_LEN {
16923 panic!(
16924 "buffer is too small (need {} bytes, but got {})",
16925 Self::ENCODED_LEN,
16926 __tmp.remaining(),
16927 )
16928 }
16929 __tmp.put_u32_le(self.uptime_ms);
16930 __tmp.put_u32_le(self.error_status.bits() as u32);
16931 __tmp.put_f32_le(self.brightness);
16932 __tmp.put_f32_le(self.strobe_period);
16933 __tmp.put_f32_le(self.strobe_duty_cycle);
16934 __tmp.put_f32_le(self.temp_c);
16935 __tmp.put_f32_le(self.min_strobe_period);
16936 __tmp.put_f32_le(self.max_strobe_period);
16937 __tmp.put_u8(self.enable);
16938 __tmp.put_u8(self.mode_bitmask as u8);
16939 __tmp.put_u8(self.mode as u8);
16940 if matches!(version, MavlinkVersion::V2) {
16941 let len = __tmp.len();
16942 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
16943 } else {
16944 __tmp.len()
16945 }
16946 }
16947}
16948#[doc = "Status of the Iridium SBD link."]
16949#[doc = ""]
16950#[doc = "ID: 335"]
16951#[derive(Debug, Clone, PartialEq)]
16952#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
16953#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
16954#[cfg_attr(feature = "ts", derive(TS))]
16955#[cfg_attr(feature = "ts", ts(export))]
16956pub struct ISBD_LINK_STATUS_DATA {
16957 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
16958 pub timestamp: u64,
16959 #[doc = "Timestamp of the last successful sbd session. The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
16960 pub last_heartbeat: u64,
16961 #[doc = "Number of failed SBD sessions."]
16962 pub failed_sessions: u16,
16963 #[doc = "Number of successful SBD sessions."]
16964 pub successful_sessions: u16,
16965 #[doc = "Signal quality equal to the number of bars displayed on the ISU signal strength indicator. Range is 0 to 5, where 0 indicates no signal and 5 indicates maximum signal strength."]
16966 pub signal_quality: u8,
16967 #[doc = "1: Ring call pending, 0: No call pending."]
16968 pub ring_pending: u8,
16969 #[doc = "1: Transmission session pending, 0: No transmission session pending."]
16970 pub tx_session_pending: u8,
16971 #[doc = "1: Receiving session pending, 0: No receiving session pending."]
16972 pub rx_session_pending: u8,
16973}
16974impl ISBD_LINK_STATUS_DATA {
16975 pub const ENCODED_LEN: usize = 24usize;
16976 pub const DEFAULT: Self = Self {
16977 timestamp: 0_u64,
16978 last_heartbeat: 0_u64,
16979 failed_sessions: 0_u16,
16980 successful_sessions: 0_u16,
16981 signal_quality: 0_u8,
16982 ring_pending: 0_u8,
16983 tx_session_pending: 0_u8,
16984 rx_session_pending: 0_u8,
16985 };
16986 #[cfg(feature = "arbitrary")]
16987 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
16988 use arbitrary::{Arbitrary, Unstructured};
16989 let mut buf = [0u8; 1024];
16990 rng.fill_bytes(&mut buf);
16991 let mut unstructured = Unstructured::new(&buf);
16992 Self::arbitrary(&mut unstructured).unwrap_or_default()
16993 }
16994}
16995impl Default for ISBD_LINK_STATUS_DATA {
16996 fn default() -> Self {
16997 Self::DEFAULT.clone()
16998 }
16999}
17000impl MessageData for ISBD_LINK_STATUS_DATA {
17001 type Message = MavMessage;
17002 const ID: u32 = 335u32;
17003 const NAME: &'static str = "ISBD_LINK_STATUS";
17004 const EXTRA_CRC: u8 = 225u8;
17005 const ENCODED_LEN: usize = 24usize;
17006 fn deser(
17007 _version: MavlinkVersion,
17008 __input: &[u8],
17009 ) -> Result<Self, ::mavlink_core::error::ParserError> {
17010 let avail_len = __input.len();
17011 let mut payload_buf = [0; Self::ENCODED_LEN];
17012 let mut buf = if avail_len < Self::ENCODED_LEN {
17013 payload_buf[0..avail_len].copy_from_slice(__input);
17014 Bytes::new(&payload_buf)
17015 } else {
17016 Bytes::new(__input)
17017 };
17018 let mut __struct = Self::default();
17019 __struct.timestamp = buf.get_u64_le();
17020 __struct.last_heartbeat = buf.get_u64_le();
17021 __struct.failed_sessions = buf.get_u16_le();
17022 __struct.successful_sessions = buf.get_u16_le();
17023 __struct.signal_quality = buf.get_u8();
17024 __struct.ring_pending = buf.get_u8();
17025 __struct.tx_session_pending = buf.get_u8();
17026 __struct.rx_session_pending = buf.get_u8();
17027 Ok(__struct)
17028 }
17029 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
17030 let mut __tmp = BytesMut::new(bytes);
17031 #[allow(clippy::absurd_extreme_comparisons)]
17032 #[allow(unused_comparisons)]
17033 if __tmp.remaining() < Self::ENCODED_LEN {
17034 panic!(
17035 "buffer is too small (need {} bytes, but got {})",
17036 Self::ENCODED_LEN,
17037 __tmp.remaining(),
17038 )
17039 }
17040 __tmp.put_u64_le(self.timestamp);
17041 __tmp.put_u64_le(self.last_heartbeat);
17042 __tmp.put_u16_le(self.failed_sessions);
17043 __tmp.put_u16_le(self.successful_sessions);
17044 __tmp.put_u8(self.signal_quality);
17045 __tmp.put_u8(self.ring_pending);
17046 __tmp.put_u8(self.tx_session_pending);
17047 __tmp.put_u8(self.rx_session_pending);
17048 if matches!(version, MavlinkVersion::V2) {
17049 let len = __tmp.len();
17050 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
17051 } else {
17052 __tmp.len()
17053 }
17054 }
17055}
17056#[doc = "The location of a landing target. See: <https://mavlink.io/en/services/landing_target.html>."]
17057#[doc = ""]
17058#[doc = "ID: 149"]
17059#[derive(Debug, Clone, PartialEq)]
17060#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
17061#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
17062#[cfg_attr(feature = "ts", derive(TS))]
17063#[cfg_attr(feature = "ts", ts(export))]
17064pub struct LANDING_TARGET_DATA {
17065 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
17066 pub time_usec: u64,
17067 #[doc = "X-axis angular offset of the target from the center of the image"]
17068 pub angle_x: f32,
17069 #[doc = "Y-axis angular offset of the target from the center of the image"]
17070 pub angle_y: f32,
17071 #[doc = "Distance to the target from the vehicle"]
17072 pub distance: f32,
17073 #[doc = "Size of target along x-axis"]
17074 pub size_x: f32,
17075 #[doc = "Size of target along y-axis"]
17076 pub size_y: f32,
17077 #[doc = "The ID of the target if multiple targets are present"]
17078 pub target_num: u8,
17079 #[doc = "Coordinate frame used for following fields."]
17080 pub frame: MavFrame,
17081 #[doc = "X Position of the landing target in MAV_FRAME"]
17082 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
17083 pub x: f32,
17084 #[doc = "Y Position of the landing target in MAV_FRAME"]
17085 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
17086 pub y: f32,
17087 #[doc = "Z Position of the landing target in MAV_FRAME"]
17088 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
17089 pub z: f32,
17090 #[doc = "Quaternion of landing target orientation (w, x, y, z order, zero-rotation is 1, 0, 0, 0)"]
17091 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
17092 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
17093 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
17094 pub q: [f32; 4],
17095 #[doc = "Type of landing target"]
17096 #[cfg_attr(feature = "serde", serde(default))]
17097 pub mavtype: LandingTargetType,
17098 #[doc = "Boolean indicating whether the position fields (x, y, z, q, type) contain valid target position information (valid: 1, invalid: 0). Default is 0 (invalid)."]
17099 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
17100 pub position_valid: u8,
17101}
17102impl LANDING_TARGET_DATA {
17103 pub const ENCODED_LEN: usize = 60usize;
17104 pub const DEFAULT: Self = Self {
17105 time_usec: 0_u64,
17106 angle_x: 0.0_f32,
17107 angle_y: 0.0_f32,
17108 distance: 0.0_f32,
17109 size_x: 0.0_f32,
17110 size_y: 0.0_f32,
17111 target_num: 0_u8,
17112 frame: MavFrame::DEFAULT,
17113 x: 0.0_f32,
17114 y: 0.0_f32,
17115 z: 0.0_f32,
17116 q: [0.0_f32; 4usize],
17117 mavtype: LandingTargetType::DEFAULT,
17118 position_valid: 0_u8,
17119 };
17120 #[cfg(feature = "arbitrary")]
17121 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
17122 use arbitrary::{Arbitrary, Unstructured};
17123 let mut buf = [0u8; 1024];
17124 rng.fill_bytes(&mut buf);
17125 let mut unstructured = Unstructured::new(&buf);
17126 Self::arbitrary(&mut unstructured).unwrap_or_default()
17127 }
17128}
17129impl Default for LANDING_TARGET_DATA {
17130 fn default() -> Self {
17131 Self::DEFAULT.clone()
17132 }
17133}
17134impl MessageData for LANDING_TARGET_DATA {
17135 type Message = MavMessage;
17136 const ID: u32 = 149u32;
17137 const NAME: &'static str = "LANDING_TARGET";
17138 const EXTRA_CRC: u8 = 200u8;
17139 const ENCODED_LEN: usize = 60usize;
17140 fn deser(
17141 _version: MavlinkVersion,
17142 __input: &[u8],
17143 ) -> Result<Self, ::mavlink_core::error::ParserError> {
17144 let avail_len = __input.len();
17145 let mut payload_buf = [0; Self::ENCODED_LEN];
17146 let mut buf = if avail_len < Self::ENCODED_LEN {
17147 payload_buf[0..avail_len].copy_from_slice(__input);
17148 Bytes::new(&payload_buf)
17149 } else {
17150 Bytes::new(__input)
17151 };
17152 let mut __struct = Self::default();
17153 __struct.time_usec = buf.get_u64_le();
17154 __struct.angle_x = buf.get_f32_le();
17155 __struct.angle_y = buf.get_f32_le();
17156 __struct.distance = buf.get_f32_le();
17157 __struct.size_x = buf.get_f32_le();
17158 __struct.size_y = buf.get_f32_le();
17159 __struct.target_num = buf.get_u8();
17160 let tmp = buf.get_u8();
17161 __struct.frame =
17162 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
17163 enum_type: "MavFrame",
17164 value: tmp as u64,
17165 })?;
17166 __struct.x = buf.get_f32_le();
17167 __struct.y = buf.get_f32_le();
17168 __struct.z = buf.get_f32_le();
17169 for v in &mut __struct.q {
17170 let val = buf.get_f32_le();
17171 *v = val;
17172 }
17173 let tmp = buf.get_u8();
17174 __struct.mavtype =
17175 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
17176 enum_type: "LandingTargetType",
17177 value: tmp as u64,
17178 })?;
17179 __struct.position_valid = buf.get_u8();
17180 Ok(__struct)
17181 }
17182 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
17183 let mut __tmp = BytesMut::new(bytes);
17184 #[allow(clippy::absurd_extreme_comparisons)]
17185 #[allow(unused_comparisons)]
17186 if __tmp.remaining() < Self::ENCODED_LEN {
17187 panic!(
17188 "buffer is too small (need {} bytes, but got {})",
17189 Self::ENCODED_LEN,
17190 __tmp.remaining(),
17191 )
17192 }
17193 __tmp.put_u64_le(self.time_usec);
17194 __tmp.put_f32_le(self.angle_x);
17195 __tmp.put_f32_le(self.angle_y);
17196 __tmp.put_f32_le(self.distance);
17197 __tmp.put_f32_le(self.size_x);
17198 __tmp.put_f32_le(self.size_y);
17199 __tmp.put_u8(self.target_num);
17200 __tmp.put_u8(self.frame as u8);
17201 if matches!(version, MavlinkVersion::V2) {
17202 __tmp.put_f32_le(self.x);
17203 __tmp.put_f32_le(self.y);
17204 __tmp.put_f32_le(self.z);
17205 for val in &self.q {
17206 __tmp.put_f32_le(*val);
17207 }
17208 __tmp.put_u8(self.mavtype as u8);
17209 __tmp.put_u8(self.position_valid);
17210 let len = __tmp.len();
17211 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
17212 } else {
17213 __tmp.len()
17214 }
17215 }
17216}
17217#[doc = "Status generated in each node in the communication chain and injected into MAVLink stream."]
17218#[doc = ""]
17219#[doc = "ID: 8"]
17220#[derive(Debug, Clone, PartialEq)]
17221#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
17222#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
17223#[cfg_attr(feature = "ts", derive(TS))]
17224#[cfg_attr(feature = "ts", ts(export))]
17225pub struct LINK_NODE_STATUS_DATA {
17226 #[doc = "Timestamp (time since system boot)."]
17227 pub timestamp: u64,
17228 #[doc = "Transmit rate"]
17229 pub tx_rate: u32,
17230 #[doc = "Receive rate"]
17231 pub rx_rate: u32,
17232 #[doc = "Messages sent"]
17233 pub messages_sent: u32,
17234 #[doc = "Messages received (estimated from counting seq)"]
17235 pub messages_received: u32,
17236 #[doc = "Messages lost (estimated from counting seq)"]
17237 pub messages_lost: u32,
17238 #[doc = "Number of bytes that could not be parsed correctly."]
17239 pub rx_parse_err: u16,
17240 #[doc = "Transmit buffer overflows. This number wraps around as it reaches UINT16_MAX"]
17241 pub tx_overflows: u16,
17242 #[doc = "Receive buffer overflows. This number wraps around as it reaches UINT16_MAX"]
17243 pub rx_overflows: u16,
17244 #[doc = "Remaining free transmit buffer space"]
17245 pub tx_buf: u8,
17246 #[doc = "Remaining free receive buffer space"]
17247 pub rx_buf: u8,
17248}
17249impl LINK_NODE_STATUS_DATA {
17250 pub const ENCODED_LEN: usize = 36usize;
17251 pub const DEFAULT: Self = Self {
17252 timestamp: 0_u64,
17253 tx_rate: 0_u32,
17254 rx_rate: 0_u32,
17255 messages_sent: 0_u32,
17256 messages_received: 0_u32,
17257 messages_lost: 0_u32,
17258 rx_parse_err: 0_u16,
17259 tx_overflows: 0_u16,
17260 rx_overflows: 0_u16,
17261 tx_buf: 0_u8,
17262 rx_buf: 0_u8,
17263 };
17264 #[cfg(feature = "arbitrary")]
17265 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
17266 use arbitrary::{Arbitrary, Unstructured};
17267 let mut buf = [0u8; 1024];
17268 rng.fill_bytes(&mut buf);
17269 let mut unstructured = Unstructured::new(&buf);
17270 Self::arbitrary(&mut unstructured).unwrap_or_default()
17271 }
17272}
17273impl Default for LINK_NODE_STATUS_DATA {
17274 fn default() -> Self {
17275 Self::DEFAULT.clone()
17276 }
17277}
17278impl MessageData for LINK_NODE_STATUS_DATA {
17279 type Message = MavMessage;
17280 const ID: u32 = 8u32;
17281 const NAME: &'static str = "LINK_NODE_STATUS";
17282 const EXTRA_CRC: u8 = 117u8;
17283 const ENCODED_LEN: usize = 36usize;
17284 fn deser(
17285 _version: MavlinkVersion,
17286 __input: &[u8],
17287 ) -> Result<Self, ::mavlink_core::error::ParserError> {
17288 let avail_len = __input.len();
17289 let mut payload_buf = [0; Self::ENCODED_LEN];
17290 let mut buf = if avail_len < Self::ENCODED_LEN {
17291 payload_buf[0..avail_len].copy_from_slice(__input);
17292 Bytes::new(&payload_buf)
17293 } else {
17294 Bytes::new(__input)
17295 };
17296 let mut __struct = Self::default();
17297 __struct.timestamp = buf.get_u64_le();
17298 __struct.tx_rate = buf.get_u32_le();
17299 __struct.rx_rate = buf.get_u32_le();
17300 __struct.messages_sent = buf.get_u32_le();
17301 __struct.messages_received = buf.get_u32_le();
17302 __struct.messages_lost = buf.get_u32_le();
17303 __struct.rx_parse_err = buf.get_u16_le();
17304 __struct.tx_overflows = buf.get_u16_le();
17305 __struct.rx_overflows = buf.get_u16_le();
17306 __struct.tx_buf = buf.get_u8();
17307 __struct.rx_buf = buf.get_u8();
17308 Ok(__struct)
17309 }
17310 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
17311 let mut __tmp = BytesMut::new(bytes);
17312 #[allow(clippy::absurd_extreme_comparisons)]
17313 #[allow(unused_comparisons)]
17314 if __tmp.remaining() < Self::ENCODED_LEN {
17315 panic!(
17316 "buffer is too small (need {} bytes, but got {})",
17317 Self::ENCODED_LEN,
17318 __tmp.remaining(),
17319 )
17320 }
17321 __tmp.put_u64_le(self.timestamp);
17322 __tmp.put_u32_le(self.tx_rate);
17323 __tmp.put_u32_le(self.rx_rate);
17324 __tmp.put_u32_le(self.messages_sent);
17325 __tmp.put_u32_le(self.messages_received);
17326 __tmp.put_u32_le(self.messages_lost);
17327 __tmp.put_u16_le(self.rx_parse_err);
17328 __tmp.put_u16_le(self.tx_overflows);
17329 __tmp.put_u16_le(self.rx_overflows);
17330 __tmp.put_u8(self.tx_buf);
17331 __tmp.put_u8(self.rx_buf);
17332 if matches!(version, MavlinkVersion::V2) {
17333 let len = __tmp.len();
17334 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
17335 } else {
17336 __tmp.len()
17337 }
17338 }
17339}
17340#[doc = "The filtered local position (e.g. fused computer vision and accelerometers). Coordinate frame is right-handed, Z-axis down (aeronautical frame, NED / north-east-down convention)."]
17341#[doc = ""]
17342#[doc = "ID: 32"]
17343#[derive(Debug, Clone, PartialEq)]
17344#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
17345#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
17346#[cfg_attr(feature = "ts", derive(TS))]
17347#[cfg_attr(feature = "ts", ts(export))]
17348pub struct LOCAL_POSITION_NED_DATA {
17349 #[doc = "Timestamp (time since system boot)."]
17350 pub time_boot_ms: u32,
17351 #[doc = "X Position"]
17352 pub x: f32,
17353 #[doc = "Y Position"]
17354 pub y: f32,
17355 #[doc = "Z Position"]
17356 pub z: f32,
17357 #[doc = "X Speed"]
17358 pub vx: f32,
17359 #[doc = "Y Speed"]
17360 pub vy: f32,
17361 #[doc = "Z Speed"]
17362 pub vz: f32,
17363}
17364impl LOCAL_POSITION_NED_DATA {
17365 pub const ENCODED_LEN: usize = 28usize;
17366 pub const DEFAULT: Self = Self {
17367 time_boot_ms: 0_u32,
17368 x: 0.0_f32,
17369 y: 0.0_f32,
17370 z: 0.0_f32,
17371 vx: 0.0_f32,
17372 vy: 0.0_f32,
17373 vz: 0.0_f32,
17374 };
17375 #[cfg(feature = "arbitrary")]
17376 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
17377 use arbitrary::{Arbitrary, Unstructured};
17378 let mut buf = [0u8; 1024];
17379 rng.fill_bytes(&mut buf);
17380 let mut unstructured = Unstructured::new(&buf);
17381 Self::arbitrary(&mut unstructured).unwrap_or_default()
17382 }
17383}
17384impl Default for LOCAL_POSITION_NED_DATA {
17385 fn default() -> Self {
17386 Self::DEFAULT.clone()
17387 }
17388}
17389impl MessageData for LOCAL_POSITION_NED_DATA {
17390 type Message = MavMessage;
17391 const ID: u32 = 32u32;
17392 const NAME: &'static str = "LOCAL_POSITION_NED";
17393 const EXTRA_CRC: u8 = 185u8;
17394 const ENCODED_LEN: usize = 28usize;
17395 fn deser(
17396 _version: MavlinkVersion,
17397 __input: &[u8],
17398 ) -> Result<Self, ::mavlink_core::error::ParserError> {
17399 let avail_len = __input.len();
17400 let mut payload_buf = [0; Self::ENCODED_LEN];
17401 let mut buf = if avail_len < Self::ENCODED_LEN {
17402 payload_buf[0..avail_len].copy_from_slice(__input);
17403 Bytes::new(&payload_buf)
17404 } else {
17405 Bytes::new(__input)
17406 };
17407 let mut __struct = Self::default();
17408 __struct.time_boot_ms = buf.get_u32_le();
17409 __struct.x = buf.get_f32_le();
17410 __struct.y = buf.get_f32_le();
17411 __struct.z = buf.get_f32_le();
17412 __struct.vx = buf.get_f32_le();
17413 __struct.vy = buf.get_f32_le();
17414 __struct.vz = buf.get_f32_le();
17415 Ok(__struct)
17416 }
17417 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
17418 let mut __tmp = BytesMut::new(bytes);
17419 #[allow(clippy::absurd_extreme_comparisons)]
17420 #[allow(unused_comparisons)]
17421 if __tmp.remaining() < Self::ENCODED_LEN {
17422 panic!(
17423 "buffer is too small (need {} bytes, but got {})",
17424 Self::ENCODED_LEN,
17425 __tmp.remaining(),
17426 )
17427 }
17428 __tmp.put_u32_le(self.time_boot_ms);
17429 __tmp.put_f32_le(self.x);
17430 __tmp.put_f32_le(self.y);
17431 __tmp.put_f32_le(self.z);
17432 __tmp.put_f32_le(self.vx);
17433 __tmp.put_f32_le(self.vy);
17434 __tmp.put_f32_le(self.vz);
17435 if matches!(version, MavlinkVersion::V2) {
17436 let len = __tmp.len();
17437 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
17438 } else {
17439 __tmp.len()
17440 }
17441 }
17442}
17443#[doc = "The filtered local position (e.g. fused computer vision and accelerometers). Coordinate frame is right-handed, Z-axis down (aeronautical frame, NED / north-east-down convention)."]
17444#[doc = ""]
17445#[doc = "ID: 64"]
17446#[derive(Debug, Clone, PartialEq)]
17447#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
17448#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
17449#[cfg_attr(feature = "ts", derive(TS))]
17450#[cfg_attr(feature = "ts", ts(export))]
17451pub struct LOCAL_POSITION_NED_COV_DATA {
17452 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
17453 pub time_usec: u64,
17454 #[doc = "X Position"]
17455 pub x: f32,
17456 #[doc = "Y Position"]
17457 pub y: f32,
17458 #[doc = "Z Position"]
17459 pub z: f32,
17460 #[doc = "X Speed"]
17461 pub vx: f32,
17462 #[doc = "Y Speed"]
17463 pub vy: f32,
17464 #[doc = "Z Speed"]
17465 pub vz: f32,
17466 #[doc = "X Acceleration"]
17467 pub ax: f32,
17468 #[doc = "Y Acceleration"]
17469 pub ay: f32,
17470 #[doc = "Z Acceleration"]
17471 pub az: f32,
17472 #[doc = "Row-major representation of position, velocity and acceleration 9x9 cross-covariance matrix upper right triangle (states: x, y, z, vx, vy, vz, ax, ay, az; first nine entries are the first ROW, next eight entries are the second row, etc.). If unknown, assign NaN value to first element in the array."]
17473 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
17474 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
17475 pub covariance: [f32; 45],
17476 #[doc = "Class id of the estimator this estimate originated from."]
17477 pub estimator_type: MavEstimatorType,
17478}
17479impl LOCAL_POSITION_NED_COV_DATA {
17480 pub const ENCODED_LEN: usize = 225usize;
17481 pub const DEFAULT: Self = Self {
17482 time_usec: 0_u64,
17483 x: 0.0_f32,
17484 y: 0.0_f32,
17485 z: 0.0_f32,
17486 vx: 0.0_f32,
17487 vy: 0.0_f32,
17488 vz: 0.0_f32,
17489 ax: 0.0_f32,
17490 ay: 0.0_f32,
17491 az: 0.0_f32,
17492 covariance: [0.0_f32; 45usize],
17493 estimator_type: MavEstimatorType::DEFAULT,
17494 };
17495 #[cfg(feature = "arbitrary")]
17496 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
17497 use arbitrary::{Arbitrary, Unstructured};
17498 let mut buf = [0u8; 1024];
17499 rng.fill_bytes(&mut buf);
17500 let mut unstructured = Unstructured::new(&buf);
17501 Self::arbitrary(&mut unstructured).unwrap_or_default()
17502 }
17503}
17504impl Default for LOCAL_POSITION_NED_COV_DATA {
17505 fn default() -> Self {
17506 Self::DEFAULT.clone()
17507 }
17508}
17509impl MessageData for LOCAL_POSITION_NED_COV_DATA {
17510 type Message = MavMessage;
17511 const ID: u32 = 64u32;
17512 const NAME: &'static str = "LOCAL_POSITION_NED_COV";
17513 const EXTRA_CRC: u8 = 191u8;
17514 const ENCODED_LEN: usize = 225usize;
17515 fn deser(
17516 _version: MavlinkVersion,
17517 __input: &[u8],
17518 ) -> Result<Self, ::mavlink_core::error::ParserError> {
17519 let avail_len = __input.len();
17520 let mut payload_buf = [0; Self::ENCODED_LEN];
17521 let mut buf = if avail_len < Self::ENCODED_LEN {
17522 payload_buf[0..avail_len].copy_from_slice(__input);
17523 Bytes::new(&payload_buf)
17524 } else {
17525 Bytes::new(__input)
17526 };
17527 let mut __struct = Self::default();
17528 __struct.time_usec = buf.get_u64_le();
17529 __struct.x = buf.get_f32_le();
17530 __struct.y = buf.get_f32_le();
17531 __struct.z = buf.get_f32_le();
17532 __struct.vx = buf.get_f32_le();
17533 __struct.vy = buf.get_f32_le();
17534 __struct.vz = buf.get_f32_le();
17535 __struct.ax = buf.get_f32_le();
17536 __struct.ay = buf.get_f32_le();
17537 __struct.az = buf.get_f32_le();
17538 for v in &mut __struct.covariance {
17539 let val = buf.get_f32_le();
17540 *v = val;
17541 }
17542 let tmp = buf.get_u8();
17543 __struct.estimator_type =
17544 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
17545 enum_type: "MavEstimatorType",
17546 value: tmp as u64,
17547 })?;
17548 Ok(__struct)
17549 }
17550 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
17551 let mut __tmp = BytesMut::new(bytes);
17552 #[allow(clippy::absurd_extreme_comparisons)]
17553 #[allow(unused_comparisons)]
17554 if __tmp.remaining() < Self::ENCODED_LEN {
17555 panic!(
17556 "buffer is too small (need {} bytes, but got {})",
17557 Self::ENCODED_LEN,
17558 __tmp.remaining(),
17559 )
17560 }
17561 __tmp.put_u64_le(self.time_usec);
17562 __tmp.put_f32_le(self.x);
17563 __tmp.put_f32_le(self.y);
17564 __tmp.put_f32_le(self.z);
17565 __tmp.put_f32_le(self.vx);
17566 __tmp.put_f32_le(self.vy);
17567 __tmp.put_f32_le(self.vz);
17568 __tmp.put_f32_le(self.ax);
17569 __tmp.put_f32_le(self.ay);
17570 __tmp.put_f32_le(self.az);
17571 for val in &self.covariance {
17572 __tmp.put_f32_le(*val);
17573 }
17574 __tmp.put_u8(self.estimator_type as u8);
17575 if matches!(version, MavlinkVersion::V2) {
17576 let len = __tmp.len();
17577 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
17578 } else {
17579 __tmp.len()
17580 }
17581 }
17582}
17583#[doc = "The offset in X, Y, Z and yaw between the LOCAL_POSITION_NED messages of MAV X and the global coordinate frame in NED coordinates. Coordinate frame is right-handed, Z-axis down (aeronautical frame, NED / north-east-down convention)."]
17584#[doc = ""]
17585#[doc = "ID: 89"]
17586#[derive(Debug, Clone, PartialEq)]
17587#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
17588#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
17589#[cfg_attr(feature = "ts", derive(TS))]
17590#[cfg_attr(feature = "ts", ts(export))]
17591pub struct LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA {
17592 #[doc = "Timestamp (time since system boot)."]
17593 pub time_boot_ms: u32,
17594 #[doc = "X Position"]
17595 pub x: f32,
17596 #[doc = "Y Position"]
17597 pub y: f32,
17598 #[doc = "Z Position"]
17599 pub z: f32,
17600 #[doc = "Roll"]
17601 pub roll: f32,
17602 #[doc = "Pitch"]
17603 pub pitch: f32,
17604 #[doc = "Yaw"]
17605 pub yaw: f32,
17606}
17607impl LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA {
17608 pub const ENCODED_LEN: usize = 28usize;
17609 pub const DEFAULT: Self = Self {
17610 time_boot_ms: 0_u32,
17611 x: 0.0_f32,
17612 y: 0.0_f32,
17613 z: 0.0_f32,
17614 roll: 0.0_f32,
17615 pitch: 0.0_f32,
17616 yaw: 0.0_f32,
17617 };
17618 #[cfg(feature = "arbitrary")]
17619 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
17620 use arbitrary::{Arbitrary, Unstructured};
17621 let mut buf = [0u8; 1024];
17622 rng.fill_bytes(&mut buf);
17623 let mut unstructured = Unstructured::new(&buf);
17624 Self::arbitrary(&mut unstructured).unwrap_or_default()
17625 }
17626}
17627impl Default for LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA {
17628 fn default() -> Self {
17629 Self::DEFAULT.clone()
17630 }
17631}
17632impl MessageData for LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA {
17633 type Message = MavMessage;
17634 const ID: u32 = 89u32;
17635 const NAME: &'static str = "LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET";
17636 const EXTRA_CRC: u8 = 231u8;
17637 const ENCODED_LEN: usize = 28usize;
17638 fn deser(
17639 _version: MavlinkVersion,
17640 __input: &[u8],
17641 ) -> Result<Self, ::mavlink_core::error::ParserError> {
17642 let avail_len = __input.len();
17643 let mut payload_buf = [0; Self::ENCODED_LEN];
17644 let mut buf = if avail_len < Self::ENCODED_LEN {
17645 payload_buf[0..avail_len].copy_from_slice(__input);
17646 Bytes::new(&payload_buf)
17647 } else {
17648 Bytes::new(__input)
17649 };
17650 let mut __struct = Self::default();
17651 __struct.time_boot_ms = buf.get_u32_le();
17652 __struct.x = buf.get_f32_le();
17653 __struct.y = buf.get_f32_le();
17654 __struct.z = buf.get_f32_le();
17655 __struct.roll = buf.get_f32_le();
17656 __struct.pitch = buf.get_f32_le();
17657 __struct.yaw = buf.get_f32_le();
17658 Ok(__struct)
17659 }
17660 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
17661 let mut __tmp = BytesMut::new(bytes);
17662 #[allow(clippy::absurd_extreme_comparisons)]
17663 #[allow(unused_comparisons)]
17664 if __tmp.remaining() < Self::ENCODED_LEN {
17665 panic!(
17666 "buffer is too small (need {} bytes, but got {})",
17667 Self::ENCODED_LEN,
17668 __tmp.remaining(),
17669 )
17670 }
17671 __tmp.put_u32_le(self.time_boot_ms);
17672 __tmp.put_f32_le(self.x);
17673 __tmp.put_f32_le(self.y);
17674 __tmp.put_f32_le(self.z);
17675 __tmp.put_f32_le(self.roll);
17676 __tmp.put_f32_le(self.pitch);
17677 __tmp.put_f32_le(self.yaw);
17678 if matches!(version, MavlinkVersion::V2) {
17679 let len = __tmp.len();
17680 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
17681 } else {
17682 __tmp.len()
17683 }
17684 }
17685}
17686#[doc = "An ack for a LOGGING_DATA_ACKED message."]
17687#[doc = ""]
17688#[doc = "ID: 268"]
17689#[derive(Debug, Clone, PartialEq)]
17690#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
17691#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
17692#[cfg_attr(feature = "ts", derive(TS))]
17693#[cfg_attr(feature = "ts", ts(export))]
17694pub struct LOGGING_ACK_DATA {
17695 #[doc = "sequence number (must match the one in LOGGING_DATA_ACKED)"]
17696 pub sequence: u16,
17697 #[doc = "system ID of the target"]
17698 pub target_system: u8,
17699 #[doc = "component ID of the target"]
17700 pub target_component: u8,
17701}
17702impl LOGGING_ACK_DATA {
17703 pub const ENCODED_LEN: usize = 4usize;
17704 pub const DEFAULT: Self = Self {
17705 sequence: 0_u16,
17706 target_system: 0_u8,
17707 target_component: 0_u8,
17708 };
17709 #[cfg(feature = "arbitrary")]
17710 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
17711 use arbitrary::{Arbitrary, Unstructured};
17712 let mut buf = [0u8; 1024];
17713 rng.fill_bytes(&mut buf);
17714 let mut unstructured = Unstructured::new(&buf);
17715 Self::arbitrary(&mut unstructured).unwrap_or_default()
17716 }
17717}
17718impl Default for LOGGING_ACK_DATA {
17719 fn default() -> Self {
17720 Self::DEFAULT.clone()
17721 }
17722}
17723impl MessageData for LOGGING_ACK_DATA {
17724 type Message = MavMessage;
17725 const ID: u32 = 268u32;
17726 const NAME: &'static str = "LOGGING_ACK";
17727 const EXTRA_CRC: u8 = 14u8;
17728 const ENCODED_LEN: usize = 4usize;
17729 fn deser(
17730 _version: MavlinkVersion,
17731 __input: &[u8],
17732 ) -> Result<Self, ::mavlink_core::error::ParserError> {
17733 let avail_len = __input.len();
17734 let mut payload_buf = [0; Self::ENCODED_LEN];
17735 let mut buf = if avail_len < Self::ENCODED_LEN {
17736 payload_buf[0..avail_len].copy_from_slice(__input);
17737 Bytes::new(&payload_buf)
17738 } else {
17739 Bytes::new(__input)
17740 };
17741 let mut __struct = Self::default();
17742 __struct.sequence = buf.get_u16_le();
17743 __struct.target_system = buf.get_u8();
17744 __struct.target_component = buf.get_u8();
17745 Ok(__struct)
17746 }
17747 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
17748 let mut __tmp = BytesMut::new(bytes);
17749 #[allow(clippy::absurd_extreme_comparisons)]
17750 #[allow(unused_comparisons)]
17751 if __tmp.remaining() < Self::ENCODED_LEN {
17752 panic!(
17753 "buffer is too small (need {} bytes, but got {})",
17754 Self::ENCODED_LEN,
17755 __tmp.remaining(),
17756 )
17757 }
17758 __tmp.put_u16_le(self.sequence);
17759 __tmp.put_u8(self.target_system);
17760 __tmp.put_u8(self.target_component);
17761 if matches!(version, MavlinkVersion::V2) {
17762 let len = __tmp.len();
17763 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
17764 } else {
17765 __tmp.len()
17766 }
17767 }
17768}
17769#[doc = "A message containing logged data (see also MAV_CMD_LOGGING_START)."]
17770#[doc = ""]
17771#[doc = "ID: 266"]
17772#[derive(Debug, Clone, PartialEq)]
17773#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
17774#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
17775#[cfg_attr(feature = "ts", derive(TS))]
17776#[cfg_attr(feature = "ts", ts(export))]
17777pub struct LOGGING_DATA_DATA {
17778 #[doc = "sequence number (can wrap)"]
17779 pub sequence: u16,
17780 #[doc = "system ID of the target"]
17781 pub target_system: u8,
17782 #[doc = "component ID of the target"]
17783 pub target_component: u8,
17784 #[doc = "data length"]
17785 pub length: u8,
17786 #[doc = "offset into data where first message starts. This can be used for recovery, when a previous message got lost (set to UINT8_MAX if no start exists)."]
17787 pub first_message_offset: u8,
17788 #[doc = "logged data"]
17789 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
17790 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
17791 pub data: [u8; 249],
17792}
17793impl LOGGING_DATA_DATA {
17794 pub const ENCODED_LEN: usize = 255usize;
17795 pub const DEFAULT: Self = Self {
17796 sequence: 0_u16,
17797 target_system: 0_u8,
17798 target_component: 0_u8,
17799 length: 0_u8,
17800 first_message_offset: 0_u8,
17801 data: [0_u8; 249usize],
17802 };
17803 #[cfg(feature = "arbitrary")]
17804 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
17805 use arbitrary::{Arbitrary, Unstructured};
17806 let mut buf = [0u8; 1024];
17807 rng.fill_bytes(&mut buf);
17808 let mut unstructured = Unstructured::new(&buf);
17809 Self::arbitrary(&mut unstructured).unwrap_or_default()
17810 }
17811}
17812impl Default for LOGGING_DATA_DATA {
17813 fn default() -> Self {
17814 Self::DEFAULT.clone()
17815 }
17816}
17817impl MessageData for LOGGING_DATA_DATA {
17818 type Message = MavMessage;
17819 const ID: u32 = 266u32;
17820 const NAME: &'static str = "LOGGING_DATA";
17821 const EXTRA_CRC: u8 = 193u8;
17822 const ENCODED_LEN: usize = 255usize;
17823 fn deser(
17824 _version: MavlinkVersion,
17825 __input: &[u8],
17826 ) -> Result<Self, ::mavlink_core::error::ParserError> {
17827 let avail_len = __input.len();
17828 let mut payload_buf = [0; Self::ENCODED_LEN];
17829 let mut buf = if avail_len < Self::ENCODED_LEN {
17830 payload_buf[0..avail_len].copy_from_slice(__input);
17831 Bytes::new(&payload_buf)
17832 } else {
17833 Bytes::new(__input)
17834 };
17835 let mut __struct = Self::default();
17836 __struct.sequence = buf.get_u16_le();
17837 __struct.target_system = buf.get_u8();
17838 __struct.target_component = buf.get_u8();
17839 __struct.length = buf.get_u8();
17840 __struct.first_message_offset = buf.get_u8();
17841 for v in &mut __struct.data {
17842 let val = buf.get_u8();
17843 *v = val;
17844 }
17845 Ok(__struct)
17846 }
17847 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
17848 let mut __tmp = BytesMut::new(bytes);
17849 #[allow(clippy::absurd_extreme_comparisons)]
17850 #[allow(unused_comparisons)]
17851 if __tmp.remaining() < Self::ENCODED_LEN {
17852 panic!(
17853 "buffer is too small (need {} bytes, but got {})",
17854 Self::ENCODED_LEN,
17855 __tmp.remaining(),
17856 )
17857 }
17858 __tmp.put_u16_le(self.sequence);
17859 __tmp.put_u8(self.target_system);
17860 __tmp.put_u8(self.target_component);
17861 __tmp.put_u8(self.length);
17862 __tmp.put_u8(self.first_message_offset);
17863 for val in &self.data {
17864 __tmp.put_u8(*val);
17865 }
17866 if matches!(version, MavlinkVersion::V2) {
17867 let len = __tmp.len();
17868 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
17869 } else {
17870 __tmp.len()
17871 }
17872 }
17873}
17874#[doc = "A message containing logged data which requires a LOGGING_ACK to be sent back."]
17875#[doc = ""]
17876#[doc = "ID: 267"]
17877#[derive(Debug, Clone, PartialEq)]
17878#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
17879#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
17880#[cfg_attr(feature = "ts", derive(TS))]
17881#[cfg_attr(feature = "ts", ts(export))]
17882pub struct LOGGING_DATA_ACKED_DATA {
17883 #[doc = "sequence number (can wrap)"]
17884 pub sequence: u16,
17885 #[doc = "system ID of the target"]
17886 pub target_system: u8,
17887 #[doc = "component ID of the target"]
17888 pub target_component: u8,
17889 #[doc = "data length"]
17890 pub length: u8,
17891 #[doc = "offset into data where first message starts. This can be used for recovery, when a previous message got lost (set to UINT8_MAX if no start exists)."]
17892 pub first_message_offset: u8,
17893 #[doc = "logged data"]
17894 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
17895 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
17896 pub data: [u8; 249],
17897}
17898impl LOGGING_DATA_ACKED_DATA {
17899 pub const ENCODED_LEN: usize = 255usize;
17900 pub const DEFAULT: Self = Self {
17901 sequence: 0_u16,
17902 target_system: 0_u8,
17903 target_component: 0_u8,
17904 length: 0_u8,
17905 first_message_offset: 0_u8,
17906 data: [0_u8; 249usize],
17907 };
17908 #[cfg(feature = "arbitrary")]
17909 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
17910 use arbitrary::{Arbitrary, Unstructured};
17911 let mut buf = [0u8; 1024];
17912 rng.fill_bytes(&mut buf);
17913 let mut unstructured = Unstructured::new(&buf);
17914 Self::arbitrary(&mut unstructured).unwrap_or_default()
17915 }
17916}
17917impl Default for LOGGING_DATA_ACKED_DATA {
17918 fn default() -> Self {
17919 Self::DEFAULT.clone()
17920 }
17921}
17922impl MessageData for LOGGING_DATA_ACKED_DATA {
17923 type Message = MavMessage;
17924 const ID: u32 = 267u32;
17925 const NAME: &'static str = "LOGGING_DATA_ACKED";
17926 const EXTRA_CRC: u8 = 35u8;
17927 const ENCODED_LEN: usize = 255usize;
17928 fn deser(
17929 _version: MavlinkVersion,
17930 __input: &[u8],
17931 ) -> Result<Self, ::mavlink_core::error::ParserError> {
17932 let avail_len = __input.len();
17933 let mut payload_buf = [0; Self::ENCODED_LEN];
17934 let mut buf = if avail_len < Self::ENCODED_LEN {
17935 payload_buf[0..avail_len].copy_from_slice(__input);
17936 Bytes::new(&payload_buf)
17937 } else {
17938 Bytes::new(__input)
17939 };
17940 let mut __struct = Self::default();
17941 __struct.sequence = buf.get_u16_le();
17942 __struct.target_system = buf.get_u8();
17943 __struct.target_component = buf.get_u8();
17944 __struct.length = buf.get_u8();
17945 __struct.first_message_offset = buf.get_u8();
17946 for v in &mut __struct.data {
17947 let val = buf.get_u8();
17948 *v = val;
17949 }
17950 Ok(__struct)
17951 }
17952 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
17953 let mut __tmp = BytesMut::new(bytes);
17954 #[allow(clippy::absurd_extreme_comparisons)]
17955 #[allow(unused_comparisons)]
17956 if __tmp.remaining() < Self::ENCODED_LEN {
17957 panic!(
17958 "buffer is too small (need {} bytes, but got {})",
17959 Self::ENCODED_LEN,
17960 __tmp.remaining(),
17961 )
17962 }
17963 __tmp.put_u16_le(self.sequence);
17964 __tmp.put_u8(self.target_system);
17965 __tmp.put_u8(self.target_component);
17966 __tmp.put_u8(self.length);
17967 __tmp.put_u8(self.first_message_offset);
17968 for val in &self.data {
17969 __tmp.put_u8(*val);
17970 }
17971 if matches!(version, MavlinkVersion::V2) {
17972 let len = __tmp.len();
17973 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
17974 } else {
17975 __tmp.len()
17976 }
17977 }
17978}
17979#[doc = "Reply to LOG_REQUEST_DATA."]
17980#[doc = ""]
17981#[doc = "ID: 120"]
17982#[derive(Debug, Clone, PartialEq)]
17983#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
17984#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
17985#[cfg_attr(feature = "ts", derive(TS))]
17986#[cfg_attr(feature = "ts", ts(export))]
17987pub struct LOG_DATA_DATA {
17988 #[doc = "Offset into the log"]
17989 pub ofs: u32,
17990 #[doc = "Log id (from LOG_ENTRY reply)"]
17991 pub id: u16,
17992 #[doc = "Number of bytes (zero for end of log)"]
17993 pub count: u8,
17994 #[doc = "log data"]
17995 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
17996 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
17997 pub data: [u8; 90],
17998}
17999impl LOG_DATA_DATA {
18000 pub const ENCODED_LEN: usize = 97usize;
18001 pub const DEFAULT: Self = Self {
18002 ofs: 0_u32,
18003 id: 0_u16,
18004 count: 0_u8,
18005 data: [0_u8; 90usize],
18006 };
18007 #[cfg(feature = "arbitrary")]
18008 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
18009 use arbitrary::{Arbitrary, Unstructured};
18010 let mut buf = [0u8; 1024];
18011 rng.fill_bytes(&mut buf);
18012 let mut unstructured = Unstructured::new(&buf);
18013 Self::arbitrary(&mut unstructured).unwrap_or_default()
18014 }
18015}
18016impl Default for LOG_DATA_DATA {
18017 fn default() -> Self {
18018 Self::DEFAULT.clone()
18019 }
18020}
18021impl MessageData for LOG_DATA_DATA {
18022 type Message = MavMessage;
18023 const ID: u32 = 120u32;
18024 const NAME: &'static str = "LOG_DATA";
18025 const EXTRA_CRC: u8 = 134u8;
18026 const ENCODED_LEN: usize = 97usize;
18027 fn deser(
18028 _version: MavlinkVersion,
18029 __input: &[u8],
18030 ) -> Result<Self, ::mavlink_core::error::ParserError> {
18031 let avail_len = __input.len();
18032 let mut payload_buf = [0; Self::ENCODED_LEN];
18033 let mut buf = if avail_len < Self::ENCODED_LEN {
18034 payload_buf[0..avail_len].copy_from_slice(__input);
18035 Bytes::new(&payload_buf)
18036 } else {
18037 Bytes::new(__input)
18038 };
18039 let mut __struct = Self::default();
18040 __struct.ofs = buf.get_u32_le();
18041 __struct.id = buf.get_u16_le();
18042 __struct.count = buf.get_u8();
18043 for v in &mut __struct.data {
18044 let val = buf.get_u8();
18045 *v = val;
18046 }
18047 Ok(__struct)
18048 }
18049 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
18050 let mut __tmp = BytesMut::new(bytes);
18051 #[allow(clippy::absurd_extreme_comparisons)]
18052 #[allow(unused_comparisons)]
18053 if __tmp.remaining() < Self::ENCODED_LEN {
18054 panic!(
18055 "buffer is too small (need {} bytes, but got {})",
18056 Self::ENCODED_LEN,
18057 __tmp.remaining(),
18058 )
18059 }
18060 __tmp.put_u32_le(self.ofs);
18061 __tmp.put_u16_le(self.id);
18062 __tmp.put_u8(self.count);
18063 for val in &self.data {
18064 __tmp.put_u8(*val);
18065 }
18066 if matches!(version, MavlinkVersion::V2) {
18067 let len = __tmp.len();
18068 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
18069 } else {
18070 __tmp.len()
18071 }
18072 }
18073}
18074#[doc = "Reply to LOG_REQUEST_LIST."]
18075#[doc = ""]
18076#[doc = "ID: 118"]
18077#[derive(Debug, Clone, PartialEq)]
18078#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
18079#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
18080#[cfg_attr(feature = "ts", derive(TS))]
18081#[cfg_attr(feature = "ts", ts(export))]
18082pub struct LOG_ENTRY_DATA {
18083 #[doc = "UTC timestamp of log since 1970, or 0 if not available"]
18084 pub time_utc: u32,
18085 #[doc = "Size of the log (may be approximate)"]
18086 pub size: u32,
18087 #[doc = "Log id"]
18088 pub id: u16,
18089 #[doc = "Total number of logs"]
18090 pub num_logs: u16,
18091 #[doc = "High log number"]
18092 pub last_log_num: u16,
18093}
18094impl LOG_ENTRY_DATA {
18095 pub const ENCODED_LEN: usize = 14usize;
18096 pub const DEFAULT: Self = Self {
18097 time_utc: 0_u32,
18098 size: 0_u32,
18099 id: 0_u16,
18100 num_logs: 0_u16,
18101 last_log_num: 0_u16,
18102 };
18103 #[cfg(feature = "arbitrary")]
18104 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
18105 use arbitrary::{Arbitrary, Unstructured};
18106 let mut buf = [0u8; 1024];
18107 rng.fill_bytes(&mut buf);
18108 let mut unstructured = Unstructured::new(&buf);
18109 Self::arbitrary(&mut unstructured).unwrap_or_default()
18110 }
18111}
18112impl Default for LOG_ENTRY_DATA {
18113 fn default() -> Self {
18114 Self::DEFAULT.clone()
18115 }
18116}
18117impl MessageData for LOG_ENTRY_DATA {
18118 type Message = MavMessage;
18119 const ID: u32 = 118u32;
18120 const NAME: &'static str = "LOG_ENTRY";
18121 const EXTRA_CRC: u8 = 56u8;
18122 const ENCODED_LEN: usize = 14usize;
18123 fn deser(
18124 _version: MavlinkVersion,
18125 __input: &[u8],
18126 ) -> Result<Self, ::mavlink_core::error::ParserError> {
18127 let avail_len = __input.len();
18128 let mut payload_buf = [0; Self::ENCODED_LEN];
18129 let mut buf = if avail_len < Self::ENCODED_LEN {
18130 payload_buf[0..avail_len].copy_from_slice(__input);
18131 Bytes::new(&payload_buf)
18132 } else {
18133 Bytes::new(__input)
18134 };
18135 let mut __struct = Self::default();
18136 __struct.time_utc = buf.get_u32_le();
18137 __struct.size = buf.get_u32_le();
18138 __struct.id = buf.get_u16_le();
18139 __struct.num_logs = buf.get_u16_le();
18140 __struct.last_log_num = buf.get_u16_le();
18141 Ok(__struct)
18142 }
18143 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
18144 let mut __tmp = BytesMut::new(bytes);
18145 #[allow(clippy::absurd_extreme_comparisons)]
18146 #[allow(unused_comparisons)]
18147 if __tmp.remaining() < Self::ENCODED_LEN {
18148 panic!(
18149 "buffer is too small (need {} bytes, but got {})",
18150 Self::ENCODED_LEN,
18151 __tmp.remaining(),
18152 )
18153 }
18154 __tmp.put_u32_le(self.time_utc);
18155 __tmp.put_u32_le(self.size);
18156 __tmp.put_u16_le(self.id);
18157 __tmp.put_u16_le(self.num_logs);
18158 __tmp.put_u16_le(self.last_log_num);
18159 if matches!(version, MavlinkVersion::V2) {
18160 let len = __tmp.len();
18161 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
18162 } else {
18163 __tmp.len()
18164 }
18165 }
18166}
18167#[doc = "Erase all logs."]
18168#[doc = ""]
18169#[doc = "ID: 121"]
18170#[derive(Debug, Clone, PartialEq)]
18171#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
18172#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
18173#[cfg_attr(feature = "ts", derive(TS))]
18174#[cfg_attr(feature = "ts", ts(export))]
18175pub struct LOG_ERASE_DATA {
18176 #[doc = "System ID"]
18177 pub target_system: u8,
18178 #[doc = "Component ID"]
18179 pub target_component: u8,
18180}
18181impl LOG_ERASE_DATA {
18182 pub const ENCODED_LEN: usize = 2usize;
18183 pub const DEFAULT: Self = Self {
18184 target_system: 0_u8,
18185 target_component: 0_u8,
18186 };
18187 #[cfg(feature = "arbitrary")]
18188 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
18189 use arbitrary::{Arbitrary, Unstructured};
18190 let mut buf = [0u8; 1024];
18191 rng.fill_bytes(&mut buf);
18192 let mut unstructured = Unstructured::new(&buf);
18193 Self::arbitrary(&mut unstructured).unwrap_or_default()
18194 }
18195}
18196impl Default for LOG_ERASE_DATA {
18197 fn default() -> Self {
18198 Self::DEFAULT.clone()
18199 }
18200}
18201impl MessageData for LOG_ERASE_DATA {
18202 type Message = MavMessage;
18203 const ID: u32 = 121u32;
18204 const NAME: &'static str = "LOG_ERASE";
18205 const EXTRA_CRC: u8 = 237u8;
18206 const ENCODED_LEN: usize = 2usize;
18207 fn deser(
18208 _version: MavlinkVersion,
18209 __input: &[u8],
18210 ) -> Result<Self, ::mavlink_core::error::ParserError> {
18211 let avail_len = __input.len();
18212 let mut payload_buf = [0; Self::ENCODED_LEN];
18213 let mut buf = if avail_len < Self::ENCODED_LEN {
18214 payload_buf[0..avail_len].copy_from_slice(__input);
18215 Bytes::new(&payload_buf)
18216 } else {
18217 Bytes::new(__input)
18218 };
18219 let mut __struct = Self::default();
18220 __struct.target_system = buf.get_u8();
18221 __struct.target_component = buf.get_u8();
18222 Ok(__struct)
18223 }
18224 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
18225 let mut __tmp = BytesMut::new(bytes);
18226 #[allow(clippy::absurd_extreme_comparisons)]
18227 #[allow(unused_comparisons)]
18228 if __tmp.remaining() < Self::ENCODED_LEN {
18229 panic!(
18230 "buffer is too small (need {} bytes, but got {})",
18231 Self::ENCODED_LEN,
18232 __tmp.remaining(),
18233 )
18234 }
18235 __tmp.put_u8(self.target_system);
18236 __tmp.put_u8(self.target_component);
18237 if matches!(version, MavlinkVersion::V2) {
18238 let len = __tmp.len();
18239 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
18240 } else {
18241 __tmp.len()
18242 }
18243 }
18244}
18245#[doc = "Request a chunk of a log."]
18246#[doc = ""]
18247#[doc = "ID: 119"]
18248#[derive(Debug, Clone, PartialEq)]
18249#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
18250#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
18251#[cfg_attr(feature = "ts", derive(TS))]
18252#[cfg_attr(feature = "ts", ts(export))]
18253pub struct LOG_REQUEST_DATA_DATA {
18254 #[doc = "Offset into the log"]
18255 pub ofs: u32,
18256 #[doc = "Number of bytes"]
18257 pub count: u32,
18258 #[doc = "Log id (from LOG_ENTRY reply)"]
18259 pub id: u16,
18260 #[doc = "System ID"]
18261 pub target_system: u8,
18262 #[doc = "Component ID"]
18263 pub target_component: u8,
18264}
18265impl LOG_REQUEST_DATA_DATA {
18266 pub const ENCODED_LEN: usize = 12usize;
18267 pub const DEFAULT: Self = Self {
18268 ofs: 0_u32,
18269 count: 0_u32,
18270 id: 0_u16,
18271 target_system: 0_u8,
18272 target_component: 0_u8,
18273 };
18274 #[cfg(feature = "arbitrary")]
18275 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
18276 use arbitrary::{Arbitrary, Unstructured};
18277 let mut buf = [0u8; 1024];
18278 rng.fill_bytes(&mut buf);
18279 let mut unstructured = Unstructured::new(&buf);
18280 Self::arbitrary(&mut unstructured).unwrap_or_default()
18281 }
18282}
18283impl Default for LOG_REQUEST_DATA_DATA {
18284 fn default() -> Self {
18285 Self::DEFAULT.clone()
18286 }
18287}
18288impl MessageData for LOG_REQUEST_DATA_DATA {
18289 type Message = MavMessage;
18290 const ID: u32 = 119u32;
18291 const NAME: &'static str = "LOG_REQUEST_DATA";
18292 const EXTRA_CRC: u8 = 116u8;
18293 const ENCODED_LEN: usize = 12usize;
18294 fn deser(
18295 _version: MavlinkVersion,
18296 __input: &[u8],
18297 ) -> Result<Self, ::mavlink_core::error::ParserError> {
18298 let avail_len = __input.len();
18299 let mut payload_buf = [0; Self::ENCODED_LEN];
18300 let mut buf = if avail_len < Self::ENCODED_LEN {
18301 payload_buf[0..avail_len].copy_from_slice(__input);
18302 Bytes::new(&payload_buf)
18303 } else {
18304 Bytes::new(__input)
18305 };
18306 let mut __struct = Self::default();
18307 __struct.ofs = buf.get_u32_le();
18308 __struct.count = buf.get_u32_le();
18309 __struct.id = buf.get_u16_le();
18310 __struct.target_system = buf.get_u8();
18311 __struct.target_component = buf.get_u8();
18312 Ok(__struct)
18313 }
18314 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
18315 let mut __tmp = BytesMut::new(bytes);
18316 #[allow(clippy::absurd_extreme_comparisons)]
18317 #[allow(unused_comparisons)]
18318 if __tmp.remaining() < Self::ENCODED_LEN {
18319 panic!(
18320 "buffer is too small (need {} bytes, but got {})",
18321 Self::ENCODED_LEN,
18322 __tmp.remaining(),
18323 )
18324 }
18325 __tmp.put_u32_le(self.ofs);
18326 __tmp.put_u32_le(self.count);
18327 __tmp.put_u16_le(self.id);
18328 __tmp.put_u8(self.target_system);
18329 __tmp.put_u8(self.target_component);
18330 if matches!(version, MavlinkVersion::V2) {
18331 let len = __tmp.len();
18332 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
18333 } else {
18334 __tmp.len()
18335 }
18336 }
18337}
18338#[doc = "Stop log transfer and resume normal logging."]
18339#[doc = ""]
18340#[doc = "ID: 122"]
18341#[derive(Debug, Clone, PartialEq)]
18342#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
18343#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
18344#[cfg_attr(feature = "ts", derive(TS))]
18345#[cfg_attr(feature = "ts", ts(export))]
18346pub struct LOG_REQUEST_END_DATA {
18347 #[doc = "System ID"]
18348 pub target_system: u8,
18349 #[doc = "Component ID"]
18350 pub target_component: u8,
18351}
18352impl LOG_REQUEST_END_DATA {
18353 pub const ENCODED_LEN: usize = 2usize;
18354 pub const DEFAULT: Self = Self {
18355 target_system: 0_u8,
18356 target_component: 0_u8,
18357 };
18358 #[cfg(feature = "arbitrary")]
18359 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
18360 use arbitrary::{Arbitrary, Unstructured};
18361 let mut buf = [0u8; 1024];
18362 rng.fill_bytes(&mut buf);
18363 let mut unstructured = Unstructured::new(&buf);
18364 Self::arbitrary(&mut unstructured).unwrap_or_default()
18365 }
18366}
18367impl Default for LOG_REQUEST_END_DATA {
18368 fn default() -> Self {
18369 Self::DEFAULT.clone()
18370 }
18371}
18372impl MessageData for LOG_REQUEST_END_DATA {
18373 type Message = MavMessage;
18374 const ID: u32 = 122u32;
18375 const NAME: &'static str = "LOG_REQUEST_END";
18376 const EXTRA_CRC: u8 = 203u8;
18377 const ENCODED_LEN: usize = 2usize;
18378 fn deser(
18379 _version: MavlinkVersion,
18380 __input: &[u8],
18381 ) -> Result<Self, ::mavlink_core::error::ParserError> {
18382 let avail_len = __input.len();
18383 let mut payload_buf = [0; Self::ENCODED_LEN];
18384 let mut buf = if avail_len < Self::ENCODED_LEN {
18385 payload_buf[0..avail_len].copy_from_slice(__input);
18386 Bytes::new(&payload_buf)
18387 } else {
18388 Bytes::new(__input)
18389 };
18390 let mut __struct = Self::default();
18391 __struct.target_system = buf.get_u8();
18392 __struct.target_component = buf.get_u8();
18393 Ok(__struct)
18394 }
18395 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
18396 let mut __tmp = BytesMut::new(bytes);
18397 #[allow(clippy::absurd_extreme_comparisons)]
18398 #[allow(unused_comparisons)]
18399 if __tmp.remaining() < Self::ENCODED_LEN {
18400 panic!(
18401 "buffer is too small (need {} bytes, but got {})",
18402 Self::ENCODED_LEN,
18403 __tmp.remaining(),
18404 )
18405 }
18406 __tmp.put_u8(self.target_system);
18407 __tmp.put_u8(self.target_component);
18408 if matches!(version, MavlinkVersion::V2) {
18409 let len = __tmp.len();
18410 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
18411 } else {
18412 __tmp.len()
18413 }
18414 }
18415}
18416#[doc = "Request a list of available logs. On some systems calling this may stop on-board logging until LOG_REQUEST_END is called. If there are no log files available this request shall be answered with one LOG_ENTRY message with id = 0 and num_logs = 0."]
18417#[doc = ""]
18418#[doc = "ID: 117"]
18419#[derive(Debug, Clone, PartialEq)]
18420#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
18421#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
18422#[cfg_attr(feature = "ts", derive(TS))]
18423#[cfg_attr(feature = "ts", ts(export))]
18424pub struct LOG_REQUEST_LIST_DATA {
18425 #[doc = "First log id (0 for first available)"]
18426 pub start: u16,
18427 #[doc = "Last log id (0xffff for last available)"]
18428 pub end: u16,
18429 #[doc = "System ID"]
18430 pub target_system: u8,
18431 #[doc = "Component ID"]
18432 pub target_component: u8,
18433}
18434impl LOG_REQUEST_LIST_DATA {
18435 pub const ENCODED_LEN: usize = 6usize;
18436 pub const DEFAULT: Self = Self {
18437 start: 0_u16,
18438 end: 0_u16,
18439 target_system: 0_u8,
18440 target_component: 0_u8,
18441 };
18442 #[cfg(feature = "arbitrary")]
18443 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
18444 use arbitrary::{Arbitrary, Unstructured};
18445 let mut buf = [0u8; 1024];
18446 rng.fill_bytes(&mut buf);
18447 let mut unstructured = Unstructured::new(&buf);
18448 Self::arbitrary(&mut unstructured).unwrap_or_default()
18449 }
18450}
18451impl Default for LOG_REQUEST_LIST_DATA {
18452 fn default() -> Self {
18453 Self::DEFAULT.clone()
18454 }
18455}
18456impl MessageData for LOG_REQUEST_LIST_DATA {
18457 type Message = MavMessage;
18458 const ID: u32 = 117u32;
18459 const NAME: &'static str = "LOG_REQUEST_LIST";
18460 const EXTRA_CRC: u8 = 128u8;
18461 const ENCODED_LEN: usize = 6usize;
18462 fn deser(
18463 _version: MavlinkVersion,
18464 __input: &[u8],
18465 ) -> Result<Self, ::mavlink_core::error::ParserError> {
18466 let avail_len = __input.len();
18467 let mut payload_buf = [0; Self::ENCODED_LEN];
18468 let mut buf = if avail_len < Self::ENCODED_LEN {
18469 payload_buf[0..avail_len].copy_from_slice(__input);
18470 Bytes::new(&payload_buf)
18471 } else {
18472 Bytes::new(__input)
18473 };
18474 let mut __struct = Self::default();
18475 __struct.start = buf.get_u16_le();
18476 __struct.end = buf.get_u16_le();
18477 __struct.target_system = buf.get_u8();
18478 __struct.target_component = buf.get_u8();
18479 Ok(__struct)
18480 }
18481 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
18482 let mut __tmp = BytesMut::new(bytes);
18483 #[allow(clippy::absurd_extreme_comparisons)]
18484 #[allow(unused_comparisons)]
18485 if __tmp.remaining() < Self::ENCODED_LEN {
18486 panic!(
18487 "buffer is too small (need {} bytes, but got {})",
18488 Self::ENCODED_LEN,
18489 __tmp.remaining(),
18490 )
18491 }
18492 __tmp.put_u16_le(self.start);
18493 __tmp.put_u16_le(self.end);
18494 __tmp.put_u8(self.target_system);
18495 __tmp.put_u8(self.target_component);
18496 if matches!(version, MavlinkVersion::V2) {
18497 let len = __tmp.len();
18498 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
18499 } else {
18500 __tmp.len()
18501 }
18502 }
18503}
18504#[doc = "Reports results of completed compass calibration. Sent until MAG_CAL_ACK received."]
18505#[doc = ""]
18506#[doc = "ID: 192"]
18507#[derive(Debug, Clone, PartialEq)]
18508#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
18509#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
18510#[cfg_attr(feature = "ts", derive(TS))]
18511#[cfg_attr(feature = "ts", ts(export))]
18512pub struct MAG_CAL_REPORT_DATA {
18513 #[doc = "RMS milligauss residuals."]
18514 pub fitness: f32,
18515 #[doc = "X offset."]
18516 pub ofs_x: f32,
18517 #[doc = "Y offset."]
18518 pub ofs_y: f32,
18519 #[doc = "Z offset."]
18520 pub ofs_z: f32,
18521 #[doc = "X diagonal (matrix 11)."]
18522 pub diag_x: f32,
18523 #[doc = "Y diagonal (matrix 22)."]
18524 pub diag_y: f32,
18525 #[doc = "Z diagonal (matrix 33)."]
18526 pub diag_z: f32,
18527 #[doc = "X off-diagonal (matrix 12 and 21)."]
18528 pub offdiag_x: f32,
18529 #[doc = "Y off-diagonal (matrix 13 and 31)."]
18530 pub offdiag_y: f32,
18531 #[doc = "Z off-diagonal (matrix 32 and 23)."]
18532 pub offdiag_z: f32,
18533 #[doc = "Compass being calibrated."]
18534 pub compass_id: u8,
18535 #[doc = "Bitmask of compasses being calibrated."]
18536 pub cal_mask: u8,
18537 #[doc = "Calibration Status."]
18538 pub cal_status: MagCalStatus,
18539 #[doc = "0=requires a MAV_CMD_DO_ACCEPT_MAG_CAL, 1=saved to parameters."]
18540 pub autosaved: u8,
18541 #[doc = "Confidence in orientation (higher is better)."]
18542 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
18543 pub orientation_confidence: f32,
18544 #[doc = "orientation before calibration."]
18545 #[cfg_attr(feature = "serde", serde(default))]
18546 pub old_orientation: MavSensorOrientation,
18547 #[doc = "orientation after calibration."]
18548 #[cfg_attr(feature = "serde", serde(default))]
18549 pub new_orientation: MavSensorOrientation,
18550 #[doc = "field radius correction factor"]
18551 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
18552 pub scale_factor: f32,
18553}
18554impl MAG_CAL_REPORT_DATA {
18555 pub const ENCODED_LEN: usize = 54usize;
18556 pub const DEFAULT: Self = Self {
18557 fitness: 0.0_f32,
18558 ofs_x: 0.0_f32,
18559 ofs_y: 0.0_f32,
18560 ofs_z: 0.0_f32,
18561 diag_x: 0.0_f32,
18562 diag_y: 0.0_f32,
18563 diag_z: 0.0_f32,
18564 offdiag_x: 0.0_f32,
18565 offdiag_y: 0.0_f32,
18566 offdiag_z: 0.0_f32,
18567 compass_id: 0_u8,
18568 cal_mask: 0_u8,
18569 cal_status: MagCalStatus::DEFAULT,
18570 autosaved: 0_u8,
18571 orientation_confidence: 0.0_f32,
18572 old_orientation: MavSensorOrientation::DEFAULT,
18573 new_orientation: MavSensorOrientation::DEFAULT,
18574 scale_factor: 0.0_f32,
18575 };
18576 #[cfg(feature = "arbitrary")]
18577 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
18578 use arbitrary::{Arbitrary, Unstructured};
18579 let mut buf = [0u8; 1024];
18580 rng.fill_bytes(&mut buf);
18581 let mut unstructured = Unstructured::new(&buf);
18582 Self::arbitrary(&mut unstructured).unwrap_or_default()
18583 }
18584}
18585impl Default for MAG_CAL_REPORT_DATA {
18586 fn default() -> Self {
18587 Self::DEFAULT.clone()
18588 }
18589}
18590impl MessageData for MAG_CAL_REPORT_DATA {
18591 type Message = MavMessage;
18592 const ID: u32 = 192u32;
18593 const NAME: &'static str = "MAG_CAL_REPORT";
18594 const EXTRA_CRC: u8 = 36u8;
18595 const ENCODED_LEN: usize = 54usize;
18596 fn deser(
18597 _version: MavlinkVersion,
18598 __input: &[u8],
18599 ) -> Result<Self, ::mavlink_core::error::ParserError> {
18600 let avail_len = __input.len();
18601 let mut payload_buf = [0; Self::ENCODED_LEN];
18602 let mut buf = if avail_len < Self::ENCODED_LEN {
18603 payload_buf[0..avail_len].copy_from_slice(__input);
18604 Bytes::new(&payload_buf)
18605 } else {
18606 Bytes::new(__input)
18607 };
18608 let mut __struct = Self::default();
18609 __struct.fitness = buf.get_f32_le();
18610 __struct.ofs_x = buf.get_f32_le();
18611 __struct.ofs_y = buf.get_f32_le();
18612 __struct.ofs_z = buf.get_f32_le();
18613 __struct.diag_x = buf.get_f32_le();
18614 __struct.diag_y = buf.get_f32_le();
18615 __struct.diag_z = buf.get_f32_le();
18616 __struct.offdiag_x = buf.get_f32_le();
18617 __struct.offdiag_y = buf.get_f32_le();
18618 __struct.offdiag_z = buf.get_f32_le();
18619 __struct.compass_id = buf.get_u8();
18620 __struct.cal_mask = buf.get_u8();
18621 let tmp = buf.get_u8();
18622 __struct.cal_status =
18623 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
18624 enum_type: "MagCalStatus",
18625 value: tmp as u64,
18626 })?;
18627 __struct.autosaved = buf.get_u8();
18628 __struct.orientation_confidence = buf.get_f32_le();
18629 let tmp = buf.get_u8();
18630 __struct.old_orientation =
18631 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
18632 enum_type: "MavSensorOrientation",
18633 value: tmp as u64,
18634 })?;
18635 let tmp = buf.get_u8();
18636 __struct.new_orientation =
18637 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
18638 enum_type: "MavSensorOrientation",
18639 value: tmp as u64,
18640 })?;
18641 __struct.scale_factor = buf.get_f32_le();
18642 Ok(__struct)
18643 }
18644 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
18645 let mut __tmp = BytesMut::new(bytes);
18646 #[allow(clippy::absurd_extreme_comparisons)]
18647 #[allow(unused_comparisons)]
18648 if __tmp.remaining() < Self::ENCODED_LEN {
18649 panic!(
18650 "buffer is too small (need {} bytes, but got {})",
18651 Self::ENCODED_LEN,
18652 __tmp.remaining(),
18653 )
18654 }
18655 __tmp.put_f32_le(self.fitness);
18656 __tmp.put_f32_le(self.ofs_x);
18657 __tmp.put_f32_le(self.ofs_y);
18658 __tmp.put_f32_le(self.ofs_z);
18659 __tmp.put_f32_le(self.diag_x);
18660 __tmp.put_f32_le(self.diag_y);
18661 __tmp.put_f32_le(self.diag_z);
18662 __tmp.put_f32_le(self.offdiag_x);
18663 __tmp.put_f32_le(self.offdiag_y);
18664 __tmp.put_f32_le(self.offdiag_z);
18665 __tmp.put_u8(self.compass_id);
18666 __tmp.put_u8(self.cal_mask);
18667 __tmp.put_u8(self.cal_status as u8);
18668 __tmp.put_u8(self.autosaved);
18669 if matches!(version, MavlinkVersion::V2) {
18670 __tmp.put_f32_le(self.orientation_confidence);
18671 __tmp.put_u8(self.old_orientation as u8);
18672 __tmp.put_u8(self.new_orientation as u8);
18673 __tmp.put_f32_le(self.scale_factor);
18674 let len = __tmp.len();
18675 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
18676 } else {
18677 __tmp.len()
18678 }
18679 }
18680}
18681#[doc = "This message provides an API for manually controlling the vehicle using standard joystick axes nomenclature, along with a joystick-like input device. Unused axes can be disabled and buttons states are transmitted as individual on/off bits of a bitmask."]
18682#[doc = ""]
18683#[doc = "ID: 69"]
18684#[derive(Debug, Clone, PartialEq)]
18685#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
18686#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
18687#[cfg_attr(feature = "ts", derive(TS))]
18688#[cfg_attr(feature = "ts", ts(export))]
18689pub struct MANUAL_CONTROL_DATA {
18690 #[doc = "X-axis, normalized to the range [-1000,1000]. A value of INT16_MAX indicates that this axis is invalid. Generally corresponds to forward(1000)-backward(-1000) movement on a joystick and the pitch of a vehicle."]
18691 pub x: i16,
18692 #[doc = "Y-axis, normalized to the range [-1000,1000]. A value of INT16_MAX indicates that this axis is invalid. Generally corresponds to left(-1000)-right(1000) movement on a joystick and the roll of a vehicle."]
18693 pub y: i16,
18694 #[doc = "Z-axis, normalized to the range [-1000,1000]. A value of INT16_MAX indicates that this axis is invalid. Generally corresponds to a separate slider movement with maximum being 1000 and minimum being -1000 on a joystick and the thrust of a vehicle. Positive values are positive thrust, negative values are negative thrust."]
18695 pub z: i16,
18696 #[doc = "R-axis, normalized to the range [-1000,1000]. A value of INT16_MAX indicates that this axis is invalid. Generally corresponds to a twisting of the joystick, with counter-clockwise being 1000 and clockwise being -1000, and the yaw of a vehicle."]
18697 pub r: i16,
18698 #[doc = "A bitfield corresponding to the joystick buttons' 0-15 current state, 1 for pressed, 0 for released. The lowest bit corresponds to Button 1."]
18699 pub buttons: u16,
18700 #[doc = "The system to be controlled."]
18701 pub target: u8,
18702 #[doc = "A bitfield corresponding to the joystick buttons' 16-31 current state, 1 for pressed, 0 for released. The lowest bit corresponds to Button 16."]
18703 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
18704 pub buttons2: u16,
18705 #[doc = "Set bits to 1 to indicate which of the following extension fields contain valid data: bit 0: pitch, bit 1: roll, bit 2: aux1, bit 3: aux2, bit 4: aux3, bit 5: aux4, bit 6: aux5, bit 7: aux6"]
18706 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
18707 pub enabled_extensions: u8,
18708 #[doc = "Pitch-only-axis, normalized to the range [-1000,1000]. Generally corresponds to pitch on vehicles with additional degrees of freedom. Valid if bit 0 of enabled_extensions field is set. Set to 0 if invalid."]
18709 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
18710 pub s: i16,
18711 #[doc = "Roll-only-axis, normalized to the range [-1000,1000]. Generally corresponds to roll on vehicles with additional degrees of freedom. Valid if bit 1 of enabled_extensions field is set. Set to 0 if invalid."]
18712 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
18713 pub t: i16,
18714 #[doc = "Aux continuous input field 1. Normalized in the range [-1000,1000]. Purpose defined by recipient. Valid data if bit 2 of enabled_extensions field is set. 0 if bit 2 is unset."]
18715 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
18716 pub aux1: i16,
18717 #[doc = "Aux continuous input field 2. Normalized in the range [-1000,1000]. Purpose defined by recipient. Valid data if bit 3 of enabled_extensions field is set. 0 if bit 3 is unset."]
18718 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
18719 pub aux2: i16,
18720 #[doc = "Aux continuous input field 3. Normalized in the range [-1000,1000]. Purpose defined by recipient. Valid data if bit 4 of enabled_extensions field is set. 0 if bit 4 is unset."]
18721 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
18722 pub aux3: i16,
18723 #[doc = "Aux continuous input field 4. Normalized in the range [-1000,1000]. Purpose defined by recipient. Valid data if bit 5 of enabled_extensions field is set. 0 if bit 5 is unset."]
18724 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
18725 pub aux4: i16,
18726 #[doc = "Aux continuous input field 5. Normalized in the range [-1000,1000]. Purpose defined by recipient. Valid data if bit 6 of enabled_extensions field is set. 0 if bit 6 is unset."]
18727 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
18728 pub aux5: i16,
18729 #[doc = "Aux continuous input field 6. Normalized in the range [-1000,1000]. Purpose defined by recipient. Valid data if bit 7 of enabled_extensions field is set. 0 if bit 7 is unset."]
18730 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
18731 pub aux6: i16,
18732}
18733impl MANUAL_CONTROL_DATA {
18734 pub const ENCODED_LEN: usize = 30usize;
18735 pub const DEFAULT: Self = Self {
18736 x: 0_i16,
18737 y: 0_i16,
18738 z: 0_i16,
18739 r: 0_i16,
18740 buttons: 0_u16,
18741 target: 0_u8,
18742 buttons2: 0_u16,
18743 enabled_extensions: 0_u8,
18744 s: 0_i16,
18745 t: 0_i16,
18746 aux1: 0_i16,
18747 aux2: 0_i16,
18748 aux3: 0_i16,
18749 aux4: 0_i16,
18750 aux5: 0_i16,
18751 aux6: 0_i16,
18752 };
18753 #[cfg(feature = "arbitrary")]
18754 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
18755 use arbitrary::{Arbitrary, Unstructured};
18756 let mut buf = [0u8; 1024];
18757 rng.fill_bytes(&mut buf);
18758 let mut unstructured = Unstructured::new(&buf);
18759 Self::arbitrary(&mut unstructured).unwrap_or_default()
18760 }
18761}
18762impl Default for MANUAL_CONTROL_DATA {
18763 fn default() -> Self {
18764 Self::DEFAULT.clone()
18765 }
18766}
18767impl MessageData for MANUAL_CONTROL_DATA {
18768 type Message = MavMessage;
18769 const ID: u32 = 69u32;
18770 const NAME: &'static str = "MANUAL_CONTROL";
18771 const EXTRA_CRC: u8 = 243u8;
18772 const ENCODED_LEN: usize = 30usize;
18773 fn deser(
18774 _version: MavlinkVersion,
18775 __input: &[u8],
18776 ) -> Result<Self, ::mavlink_core::error::ParserError> {
18777 let avail_len = __input.len();
18778 let mut payload_buf = [0; Self::ENCODED_LEN];
18779 let mut buf = if avail_len < Self::ENCODED_LEN {
18780 payload_buf[0..avail_len].copy_from_slice(__input);
18781 Bytes::new(&payload_buf)
18782 } else {
18783 Bytes::new(__input)
18784 };
18785 let mut __struct = Self::default();
18786 __struct.x = buf.get_i16_le();
18787 __struct.y = buf.get_i16_le();
18788 __struct.z = buf.get_i16_le();
18789 __struct.r = buf.get_i16_le();
18790 __struct.buttons = buf.get_u16_le();
18791 __struct.target = buf.get_u8();
18792 __struct.buttons2 = buf.get_u16_le();
18793 __struct.enabled_extensions = buf.get_u8();
18794 __struct.s = buf.get_i16_le();
18795 __struct.t = buf.get_i16_le();
18796 __struct.aux1 = buf.get_i16_le();
18797 __struct.aux2 = buf.get_i16_le();
18798 __struct.aux3 = buf.get_i16_le();
18799 __struct.aux4 = buf.get_i16_le();
18800 __struct.aux5 = buf.get_i16_le();
18801 __struct.aux6 = buf.get_i16_le();
18802 Ok(__struct)
18803 }
18804 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
18805 let mut __tmp = BytesMut::new(bytes);
18806 #[allow(clippy::absurd_extreme_comparisons)]
18807 #[allow(unused_comparisons)]
18808 if __tmp.remaining() < Self::ENCODED_LEN {
18809 panic!(
18810 "buffer is too small (need {} bytes, but got {})",
18811 Self::ENCODED_LEN,
18812 __tmp.remaining(),
18813 )
18814 }
18815 __tmp.put_i16_le(self.x);
18816 __tmp.put_i16_le(self.y);
18817 __tmp.put_i16_le(self.z);
18818 __tmp.put_i16_le(self.r);
18819 __tmp.put_u16_le(self.buttons);
18820 __tmp.put_u8(self.target);
18821 if matches!(version, MavlinkVersion::V2) {
18822 __tmp.put_u16_le(self.buttons2);
18823 __tmp.put_u8(self.enabled_extensions);
18824 __tmp.put_i16_le(self.s);
18825 __tmp.put_i16_le(self.t);
18826 __tmp.put_i16_le(self.aux1);
18827 __tmp.put_i16_le(self.aux2);
18828 __tmp.put_i16_le(self.aux3);
18829 __tmp.put_i16_le(self.aux4);
18830 __tmp.put_i16_le(self.aux5);
18831 __tmp.put_i16_le(self.aux6);
18832 let len = __tmp.len();
18833 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
18834 } else {
18835 __tmp.len()
18836 }
18837 }
18838}
18839#[doc = "Setpoint in roll, pitch, yaw and thrust from the operator."]
18840#[doc = ""]
18841#[doc = "ID: 81"]
18842#[derive(Debug, Clone, PartialEq)]
18843#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
18844#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
18845#[cfg_attr(feature = "ts", derive(TS))]
18846#[cfg_attr(feature = "ts", ts(export))]
18847pub struct MANUAL_SETPOINT_DATA {
18848 #[doc = "Timestamp (time since system boot)."]
18849 pub time_boot_ms: u32,
18850 #[doc = "Desired roll rate"]
18851 pub roll: f32,
18852 #[doc = "Desired pitch rate"]
18853 pub pitch: f32,
18854 #[doc = "Desired yaw rate"]
18855 pub yaw: f32,
18856 #[doc = "Collective thrust, normalized to 0 .. 1"]
18857 pub thrust: f32,
18858 #[doc = "Flight mode switch position, 0.. 255"]
18859 pub mode_switch: u8,
18860 #[doc = "Override mode switch position, 0.. 255"]
18861 pub manual_override_switch: u8,
18862}
18863impl MANUAL_SETPOINT_DATA {
18864 pub const ENCODED_LEN: usize = 22usize;
18865 pub const DEFAULT: Self = Self {
18866 time_boot_ms: 0_u32,
18867 roll: 0.0_f32,
18868 pitch: 0.0_f32,
18869 yaw: 0.0_f32,
18870 thrust: 0.0_f32,
18871 mode_switch: 0_u8,
18872 manual_override_switch: 0_u8,
18873 };
18874 #[cfg(feature = "arbitrary")]
18875 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
18876 use arbitrary::{Arbitrary, Unstructured};
18877 let mut buf = [0u8; 1024];
18878 rng.fill_bytes(&mut buf);
18879 let mut unstructured = Unstructured::new(&buf);
18880 Self::arbitrary(&mut unstructured).unwrap_or_default()
18881 }
18882}
18883impl Default for MANUAL_SETPOINT_DATA {
18884 fn default() -> Self {
18885 Self::DEFAULT.clone()
18886 }
18887}
18888impl MessageData for MANUAL_SETPOINT_DATA {
18889 type Message = MavMessage;
18890 const ID: u32 = 81u32;
18891 const NAME: &'static str = "MANUAL_SETPOINT";
18892 const EXTRA_CRC: u8 = 106u8;
18893 const ENCODED_LEN: usize = 22usize;
18894 fn deser(
18895 _version: MavlinkVersion,
18896 __input: &[u8],
18897 ) -> Result<Self, ::mavlink_core::error::ParserError> {
18898 let avail_len = __input.len();
18899 let mut payload_buf = [0; Self::ENCODED_LEN];
18900 let mut buf = if avail_len < Self::ENCODED_LEN {
18901 payload_buf[0..avail_len].copy_from_slice(__input);
18902 Bytes::new(&payload_buf)
18903 } else {
18904 Bytes::new(__input)
18905 };
18906 let mut __struct = Self::default();
18907 __struct.time_boot_ms = buf.get_u32_le();
18908 __struct.roll = buf.get_f32_le();
18909 __struct.pitch = buf.get_f32_le();
18910 __struct.yaw = buf.get_f32_le();
18911 __struct.thrust = buf.get_f32_le();
18912 __struct.mode_switch = buf.get_u8();
18913 __struct.manual_override_switch = buf.get_u8();
18914 Ok(__struct)
18915 }
18916 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
18917 let mut __tmp = BytesMut::new(bytes);
18918 #[allow(clippy::absurd_extreme_comparisons)]
18919 #[allow(unused_comparisons)]
18920 if __tmp.remaining() < Self::ENCODED_LEN {
18921 panic!(
18922 "buffer is too small (need {} bytes, but got {})",
18923 Self::ENCODED_LEN,
18924 __tmp.remaining(),
18925 )
18926 }
18927 __tmp.put_u32_le(self.time_boot_ms);
18928 __tmp.put_f32_le(self.roll);
18929 __tmp.put_f32_le(self.pitch);
18930 __tmp.put_f32_le(self.yaw);
18931 __tmp.put_f32_le(self.thrust);
18932 __tmp.put_u8(self.mode_switch);
18933 __tmp.put_u8(self.manual_override_switch);
18934 if matches!(version, MavlinkVersion::V2) {
18935 let len = __tmp.len();
18936 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
18937 } else {
18938 __tmp.len()
18939 }
18940 }
18941}
18942#[doc = "Send raw controller memory. The use of this message is discouraged for normal packets, but a quite efficient way for testing new messages and getting experimental debug output."]
18943#[doc = ""]
18944#[doc = "ID: 249"]
18945#[derive(Debug, Clone, PartialEq)]
18946#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
18947#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
18948#[cfg_attr(feature = "ts", derive(TS))]
18949#[cfg_attr(feature = "ts", ts(export))]
18950pub struct MEMORY_VECT_DATA {
18951 #[doc = "Starting address of the debug variables"]
18952 pub address: u16,
18953 #[doc = "Version code of the type variable. 0=unknown, type ignored and assumed int16_t. 1=as below"]
18954 pub ver: u8,
18955 #[doc = "Type code of the memory variables. for ver = 1: 0=16 x int16_t, 1=16 x uint16_t, 2=16 x Q15, 3=16 x 1Q14"]
18956 pub mavtype: u8,
18957 #[doc = "Memory contents at specified address"]
18958 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
18959 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
18960 pub value: [i8; 32],
18961}
18962impl MEMORY_VECT_DATA {
18963 pub const ENCODED_LEN: usize = 36usize;
18964 pub const DEFAULT: Self = Self {
18965 address: 0_u16,
18966 ver: 0_u8,
18967 mavtype: 0_u8,
18968 value: [0_i8; 32usize],
18969 };
18970 #[cfg(feature = "arbitrary")]
18971 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
18972 use arbitrary::{Arbitrary, Unstructured};
18973 let mut buf = [0u8; 1024];
18974 rng.fill_bytes(&mut buf);
18975 let mut unstructured = Unstructured::new(&buf);
18976 Self::arbitrary(&mut unstructured).unwrap_or_default()
18977 }
18978}
18979impl Default for MEMORY_VECT_DATA {
18980 fn default() -> Self {
18981 Self::DEFAULT.clone()
18982 }
18983}
18984impl MessageData for MEMORY_VECT_DATA {
18985 type Message = MavMessage;
18986 const ID: u32 = 249u32;
18987 const NAME: &'static str = "MEMORY_VECT";
18988 const EXTRA_CRC: u8 = 204u8;
18989 const ENCODED_LEN: usize = 36usize;
18990 fn deser(
18991 _version: MavlinkVersion,
18992 __input: &[u8],
18993 ) -> Result<Self, ::mavlink_core::error::ParserError> {
18994 let avail_len = __input.len();
18995 let mut payload_buf = [0; Self::ENCODED_LEN];
18996 let mut buf = if avail_len < Self::ENCODED_LEN {
18997 payload_buf[0..avail_len].copy_from_slice(__input);
18998 Bytes::new(&payload_buf)
18999 } else {
19000 Bytes::new(__input)
19001 };
19002 let mut __struct = Self::default();
19003 __struct.address = buf.get_u16_le();
19004 __struct.ver = buf.get_u8();
19005 __struct.mavtype = buf.get_u8();
19006 for v in &mut __struct.value {
19007 let val = buf.get_i8();
19008 *v = val;
19009 }
19010 Ok(__struct)
19011 }
19012 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
19013 let mut __tmp = BytesMut::new(bytes);
19014 #[allow(clippy::absurd_extreme_comparisons)]
19015 #[allow(unused_comparisons)]
19016 if __tmp.remaining() < Self::ENCODED_LEN {
19017 panic!(
19018 "buffer is too small (need {} bytes, but got {})",
19019 Self::ENCODED_LEN,
19020 __tmp.remaining(),
19021 )
19022 }
19023 __tmp.put_u16_le(self.address);
19024 __tmp.put_u8(self.ver);
19025 __tmp.put_u8(self.mavtype);
19026 for val in &self.value {
19027 __tmp.put_i8(*val);
19028 }
19029 if matches!(version, MavlinkVersion::V2) {
19030 let len = __tmp.len();
19031 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
19032 } else {
19033 __tmp.len()
19034 }
19035 }
19036}
19037#[doc = "The interval between messages for a particular MAVLink message ID. This message is sent in response to the MAV_CMD_REQUEST_MESSAGE command with param1=244 (this message) and param2=message_id (the id of the message for which the interval is required). \tIt may also be sent in response to MAV_CMD_GET_MESSAGE_INTERVAL. \tThis interface replaces DATA_STREAM."]
19038#[doc = ""]
19039#[doc = "ID: 244"]
19040#[derive(Debug, Clone, PartialEq)]
19041#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
19042#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
19043#[cfg_attr(feature = "ts", derive(TS))]
19044#[cfg_attr(feature = "ts", ts(export))]
19045pub struct MESSAGE_INTERVAL_DATA {
19046 #[doc = "0 indicates the interval at which it is sent."]
19047 pub interval_us: i32,
19048 #[doc = "The ID of the requested MAVLink message. v1.0 is limited to 254 messages."]
19049 pub message_id: u16,
19050}
19051impl MESSAGE_INTERVAL_DATA {
19052 pub const ENCODED_LEN: usize = 6usize;
19053 pub const DEFAULT: Self = Self {
19054 interval_us: 0_i32,
19055 message_id: 0_u16,
19056 };
19057 #[cfg(feature = "arbitrary")]
19058 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
19059 use arbitrary::{Arbitrary, Unstructured};
19060 let mut buf = [0u8; 1024];
19061 rng.fill_bytes(&mut buf);
19062 let mut unstructured = Unstructured::new(&buf);
19063 Self::arbitrary(&mut unstructured).unwrap_or_default()
19064 }
19065}
19066impl Default for MESSAGE_INTERVAL_DATA {
19067 fn default() -> Self {
19068 Self::DEFAULT.clone()
19069 }
19070}
19071impl MessageData for MESSAGE_INTERVAL_DATA {
19072 type Message = MavMessage;
19073 const ID: u32 = 244u32;
19074 const NAME: &'static str = "MESSAGE_INTERVAL";
19075 const EXTRA_CRC: u8 = 95u8;
19076 const ENCODED_LEN: usize = 6usize;
19077 fn deser(
19078 _version: MavlinkVersion,
19079 __input: &[u8],
19080 ) -> Result<Self, ::mavlink_core::error::ParserError> {
19081 let avail_len = __input.len();
19082 let mut payload_buf = [0; Self::ENCODED_LEN];
19083 let mut buf = if avail_len < Self::ENCODED_LEN {
19084 payload_buf[0..avail_len].copy_from_slice(__input);
19085 Bytes::new(&payload_buf)
19086 } else {
19087 Bytes::new(__input)
19088 };
19089 let mut __struct = Self::default();
19090 __struct.interval_us = buf.get_i32_le();
19091 __struct.message_id = buf.get_u16_le();
19092 Ok(__struct)
19093 }
19094 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
19095 let mut __tmp = BytesMut::new(bytes);
19096 #[allow(clippy::absurd_extreme_comparisons)]
19097 #[allow(unused_comparisons)]
19098 if __tmp.remaining() < Self::ENCODED_LEN {
19099 panic!(
19100 "buffer is too small (need {} bytes, but got {})",
19101 Self::ENCODED_LEN,
19102 __tmp.remaining(),
19103 )
19104 }
19105 __tmp.put_i32_le(self.interval_us);
19106 __tmp.put_u16_le(self.message_id);
19107 if matches!(version, MavlinkVersion::V2) {
19108 let len = __tmp.len();
19109 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
19110 } else {
19111 __tmp.len()
19112 }
19113 }
19114}
19115#[doc = "Acknowledgment message during waypoint handling. The type field states if this message is a positive ack (type=0) or if an error happened (type=non-zero)."]
19116#[doc = ""]
19117#[doc = "ID: 47"]
19118#[derive(Debug, Clone, PartialEq)]
19119#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
19120#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
19121#[cfg_attr(feature = "ts", derive(TS))]
19122#[cfg_attr(feature = "ts", ts(export))]
19123pub struct MISSION_ACK_DATA {
19124 #[doc = "System ID"]
19125 pub target_system: u8,
19126 #[doc = "Component ID"]
19127 pub target_component: u8,
19128 #[doc = "Mission result."]
19129 pub mavtype: MavMissionResult,
19130 #[doc = "Mission type."]
19131 #[cfg_attr(feature = "serde", serde(default))]
19132 pub mission_type: MavMissionType,
19133 #[doc = "Id of new on-vehicle mission, fence, or rally point plan (on upload to vehicle). The id is calculated and returned by a vehicle when a new plan is uploaded by a GCS. The only requirement on the id is that it must change when there is any change to the on-vehicle plan type (there is no requirement that the id be globally unique). 0 on download from the vehicle to the GCS (on download the ID is set in MISSION_COUNT). 0 if plan ids are not supported. The current on-vehicle plan ids are streamed in `MISSION_CURRENT`, allowing a GCS to determine if any part of the plan has changed and needs to be re-uploaded."]
19134 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
19135 pub opaque_id: u32,
19136}
19137impl MISSION_ACK_DATA {
19138 pub const ENCODED_LEN: usize = 8usize;
19139 pub const DEFAULT: Self = Self {
19140 target_system: 0_u8,
19141 target_component: 0_u8,
19142 mavtype: MavMissionResult::DEFAULT,
19143 mission_type: MavMissionType::DEFAULT,
19144 opaque_id: 0_u32,
19145 };
19146 #[cfg(feature = "arbitrary")]
19147 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
19148 use arbitrary::{Arbitrary, Unstructured};
19149 let mut buf = [0u8; 1024];
19150 rng.fill_bytes(&mut buf);
19151 let mut unstructured = Unstructured::new(&buf);
19152 Self::arbitrary(&mut unstructured).unwrap_or_default()
19153 }
19154}
19155impl Default for MISSION_ACK_DATA {
19156 fn default() -> Self {
19157 Self::DEFAULT.clone()
19158 }
19159}
19160impl MessageData for MISSION_ACK_DATA {
19161 type Message = MavMessage;
19162 const ID: u32 = 47u32;
19163 const NAME: &'static str = "MISSION_ACK";
19164 const EXTRA_CRC: u8 = 153u8;
19165 const ENCODED_LEN: usize = 8usize;
19166 fn deser(
19167 _version: MavlinkVersion,
19168 __input: &[u8],
19169 ) -> Result<Self, ::mavlink_core::error::ParserError> {
19170 let avail_len = __input.len();
19171 let mut payload_buf = [0; Self::ENCODED_LEN];
19172 let mut buf = if avail_len < Self::ENCODED_LEN {
19173 payload_buf[0..avail_len].copy_from_slice(__input);
19174 Bytes::new(&payload_buf)
19175 } else {
19176 Bytes::new(__input)
19177 };
19178 let mut __struct = Self::default();
19179 __struct.target_system = buf.get_u8();
19180 __struct.target_component = buf.get_u8();
19181 let tmp = buf.get_u8();
19182 __struct.mavtype =
19183 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
19184 enum_type: "MavMissionResult",
19185 value: tmp as u64,
19186 })?;
19187 let tmp = buf.get_u8();
19188 __struct.mission_type =
19189 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
19190 enum_type: "MavMissionType",
19191 value: tmp as u64,
19192 })?;
19193 __struct.opaque_id = buf.get_u32_le();
19194 Ok(__struct)
19195 }
19196 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
19197 let mut __tmp = BytesMut::new(bytes);
19198 #[allow(clippy::absurd_extreme_comparisons)]
19199 #[allow(unused_comparisons)]
19200 if __tmp.remaining() < Self::ENCODED_LEN {
19201 panic!(
19202 "buffer is too small (need {} bytes, but got {})",
19203 Self::ENCODED_LEN,
19204 __tmp.remaining(),
19205 )
19206 }
19207 __tmp.put_u8(self.target_system);
19208 __tmp.put_u8(self.target_component);
19209 __tmp.put_u8(self.mavtype as u8);
19210 if matches!(version, MavlinkVersion::V2) {
19211 __tmp.put_u8(self.mission_type as u8);
19212 __tmp.put_u32_le(self.opaque_id);
19213 let len = __tmp.len();
19214 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
19215 } else {
19216 __tmp.len()
19217 }
19218 }
19219}
19220#[doc = "Delete all mission items at once."]
19221#[doc = ""]
19222#[doc = "ID: 45"]
19223#[derive(Debug, Clone, PartialEq)]
19224#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
19225#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
19226#[cfg_attr(feature = "ts", derive(TS))]
19227#[cfg_attr(feature = "ts", ts(export))]
19228pub struct MISSION_CLEAR_ALL_DATA {
19229 #[doc = "System ID"]
19230 pub target_system: u8,
19231 #[doc = "Component ID"]
19232 pub target_component: u8,
19233 #[doc = "Mission type."]
19234 #[cfg_attr(feature = "serde", serde(default))]
19235 pub mission_type: MavMissionType,
19236}
19237impl MISSION_CLEAR_ALL_DATA {
19238 pub const ENCODED_LEN: usize = 3usize;
19239 pub const DEFAULT: Self = Self {
19240 target_system: 0_u8,
19241 target_component: 0_u8,
19242 mission_type: MavMissionType::DEFAULT,
19243 };
19244 #[cfg(feature = "arbitrary")]
19245 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
19246 use arbitrary::{Arbitrary, Unstructured};
19247 let mut buf = [0u8; 1024];
19248 rng.fill_bytes(&mut buf);
19249 let mut unstructured = Unstructured::new(&buf);
19250 Self::arbitrary(&mut unstructured).unwrap_or_default()
19251 }
19252}
19253impl Default for MISSION_CLEAR_ALL_DATA {
19254 fn default() -> Self {
19255 Self::DEFAULT.clone()
19256 }
19257}
19258impl MessageData for MISSION_CLEAR_ALL_DATA {
19259 type Message = MavMessage;
19260 const ID: u32 = 45u32;
19261 const NAME: &'static str = "MISSION_CLEAR_ALL";
19262 const EXTRA_CRC: u8 = 232u8;
19263 const ENCODED_LEN: usize = 3usize;
19264 fn deser(
19265 _version: MavlinkVersion,
19266 __input: &[u8],
19267 ) -> Result<Self, ::mavlink_core::error::ParserError> {
19268 let avail_len = __input.len();
19269 let mut payload_buf = [0; Self::ENCODED_LEN];
19270 let mut buf = if avail_len < Self::ENCODED_LEN {
19271 payload_buf[0..avail_len].copy_from_slice(__input);
19272 Bytes::new(&payload_buf)
19273 } else {
19274 Bytes::new(__input)
19275 };
19276 let mut __struct = Self::default();
19277 __struct.target_system = buf.get_u8();
19278 __struct.target_component = buf.get_u8();
19279 let tmp = buf.get_u8();
19280 __struct.mission_type =
19281 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
19282 enum_type: "MavMissionType",
19283 value: tmp as u64,
19284 })?;
19285 Ok(__struct)
19286 }
19287 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
19288 let mut __tmp = BytesMut::new(bytes);
19289 #[allow(clippy::absurd_extreme_comparisons)]
19290 #[allow(unused_comparisons)]
19291 if __tmp.remaining() < Self::ENCODED_LEN {
19292 panic!(
19293 "buffer is too small (need {} bytes, but got {})",
19294 Self::ENCODED_LEN,
19295 __tmp.remaining(),
19296 )
19297 }
19298 __tmp.put_u8(self.target_system);
19299 __tmp.put_u8(self.target_component);
19300 if matches!(version, MavlinkVersion::V2) {
19301 __tmp.put_u8(self.mission_type as u8);
19302 let len = __tmp.len();
19303 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
19304 } else {
19305 __tmp.len()
19306 }
19307 }
19308}
19309#[doc = "This message is emitted as response to MISSION_REQUEST_LIST by the MAV and to initiate a write transaction. The GCS can then request the individual mission item based on the knowledge of the total number of waypoints."]
19310#[doc = ""]
19311#[doc = "ID: 44"]
19312#[derive(Debug, Clone, PartialEq)]
19313#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
19314#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
19315#[cfg_attr(feature = "ts", derive(TS))]
19316#[cfg_attr(feature = "ts", ts(export))]
19317pub struct MISSION_COUNT_DATA {
19318 #[doc = "Number of mission items in the sequence"]
19319 pub count: u16,
19320 #[doc = "System ID"]
19321 pub target_system: u8,
19322 #[doc = "Component ID"]
19323 pub target_component: u8,
19324 #[doc = "Mission type."]
19325 #[cfg_attr(feature = "serde", serde(default))]
19326 pub mission_type: MavMissionType,
19327 #[doc = "Id of current on-vehicle mission, fence, or rally point plan (on download from vehicle). This field is used when downloading a plan from a vehicle to a GCS. 0 on upload to the vehicle from GCS. 0 if plan ids are not supported. The current on-vehicle plan ids are streamed in `MISSION_CURRENT`, allowing a GCS to determine if any part of the plan has changed and needs to be re-uploaded. The ids are recalculated by the vehicle when any part of the on-vehicle plan changes (when a new plan is uploaded, the vehicle returns the new id to the GCS in MISSION_ACK)."]
19328 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
19329 pub opaque_id: u32,
19330}
19331impl MISSION_COUNT_DATA {
19332 pub const ENCODED_LEN: usize = 9usize;
19333 pub const DEFAULT: Self = Self {
19334 count: 0_u16,
19335 target_system: 0_u8,
19336 target_component: 0_u8,
19337 mission_type: MavMissionType::DEFAULT,
19338 opaque_id: 0_u32,
19339 };
19340 #[cfg(feature = "arbitrary")]
19341 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
19342 use arbitrary::{Arbitrary, Unstructured};
19343 let mut buf = [0u8; 1024];
19344 rng.fill_bytes(&mut buf);
19345 let mut unstructured = Unstructured::new(&buf);
19346 Self::arbitrary(&mut unstructured).unwrap_or_default()
19347 }
19348}
19349impl Default for MISSION_COUNT_DATA {
19350 fn default() -> Self {
19351 Self::DEFAULT.clone()
19352 }
19353}
19354impl MessageData for MISSION_COUNT_DATA {
19355 type Message = MavMessage;
19356 const ID: u32 = 44u32;
19357 const NAME: &'static str = "MISSION_COUNT";
19358 const EXTRA_CRC: u8 = 221u8;
19359 const ENCODED_LEN: usize = 9usize;
19360 fn deser(
19361 _version: MavlinkVersion,
19362 __input: &[u8],
19363 ) -> Result<Self, ::mavlink_core::error::ParserError> {
19364 let avail_len = __input.len();
19365 let mut payload_buf = [0; Self::ENCODED_LEN];
19366 let mut buf = if avail_len < Self::ENCODED_LEN {
19367 payload_buf[0..avail_len].copy_from_slice(__input);
19368 Bytes::new(&payload_buf)
19369 } else {
19370 Bytes::new(__input)
19371 };
19372 let mut __struct = Self::default();
19373 __struct.count = buf.get_u16_le();
19374 __struct.target_system = buf.get_u8();
19375 __struct.target_component = buf.get_u8();
19376 let tmp = buf.get_u8();
19377 __struct.mission_type =
19378 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
19379 enum_type: "MavMissionType",
19380 value: tmp as u64,
19381 })?;
19382 __struct.opaque_id = buf.get_u32_le();
19383 Ok(__struct)
19384 }
19385 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
19386 let mut __tmp = BytesMut::new(bytes);
19387 #[allow(clippy::absurd_extreme_comparisons)]
19388 #[allow(unused_comparisons)]
19389 if __tmp.remaining() < Self::ENCODED_LEN {
19390 panic!(
19391 "buffer is too small (need {} bytes, but got {})",
19392 Self::ENCODED_LEN,
19393 __tmp.remaining(),
19394 )
19395 }
19396 __tmp.put_u16_le(self.count);
19397 __tmp.put_u8(self.target_system);
19398 __tmp.put_u8(self.target_component);
19399 if matches!(version, MavlinkVersion::V2) {
19400 __tmp.put_u8(self.mission_type as u8);
19401 __tmp.put_u32_le(self.opaque_id);
19402 let len = __tmp.len();
19403 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
19404 } else {
19405 __tmp.len()
19406 }
19407 }
19408}
19409#[doc = "Message that announces the sequence number of the current target mission item (that the system will fly towards/execute when the mission is running). This message should be streamed all the time (nominally at 1Hz). This message should be emitted following a call to MAV_CMD_DO_SET_MISSION_CURRENT or MISSION_SET_CURRENT."]
19410#[doc = ""]
19411#[doc = "ID: 42"]
19412#[derive(Debug, Clone, PartialEq)]
19413#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
19414#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
19415#[cfg_attr(feature = "ts", derive(TS))]
19416#[cfg_attr(feature = "ts", ts(export))]
19417pub struct MISSION_CURRENT_DATA {
19418 #[doc = "Sequence"]
19419 pub seq: u16,
19420 #[doc = "Total number of mission items on vehicle (on last item, sequence == total). If the autopilot stores its home location as part of the mission this will be excluded from the total. 0: Not supported, UINT16_MAX if no mission is present on the vehicle."]
19421 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
19422 pub total: u16,
19423 #[doc = "Mission state machine state. MISSION_STATE_UNKNOWN if state reporting not supported."]
19424 #[cfg_attr(feature = "serde", serde(default))]
19425 pub mission_state: MissionState,
19426 #[doc = "Vehicle is in a mode that can execute mission items or suspended. 0: Unknown, 1: In mission mode, 2: Suspended (not in mission mode)."]
19427 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
19428 pub mission_mode: u8,
19429 #[doc = "Id of current on-vehicle mission plan, or 0 if IDs are not supported or there is no mission loaded. GCS can use this to track changes to the mission plan type. The same value is returned on mission upload (in the MISSION_ACK)."]
19430 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
19431 pub mission_id: u32,
19432 #[doc = "Id of current on-vehicle fence plan, or 0 if IDs are not supported or there is no fence loaded. GCS can use this to track changes to the fence plan type. The same value is returned on fence upload (in the MISSION_ACK)."]
19433 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
19434 pub fence_id: u32,
19435 #[doc = "Id of current on-vehicle rally point plan, or 0 if IDs are not supported or there are no rally points loaded. GCS can use this to track changes to the rally point plan type. The same value is returned on rally point upload (in the MISSION_ACK)."]
19436 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
19437 pub rally_points_id: u32,
19438}
19439impl MISSION_CURRENT_DATA {
19440 pub const ENCODED_LEN: usize = 18usize;
19441 pub const DEFAULT: Self = Self {
19442 seq: 0_u16,
19443 total: 0_u16,
19444 mission_state: MissionState::DEFAULT,
19445 mission_mode: 0_u8,
19446 mission_id: 0_u32,
19447 fence_id: 0_u32,
19448 rally_points_id: 0_u32,
19449 };
19450 #[cfg(feature = "arbitrary")]
19451 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
19452 use arbitrary::{Arbitrary, Unstructured};
19453 let mut buf = [0u8; 1024];
19454 rng.fill_bytes(&mut buf);
19455 let mut unstructured = Unstructured::new(&buf);
19456 Self::arbitrary(&mut unstructured).unwrap_or_default()
19457 }
19458}
19459impl Default for MISSION_CURRENT_DATA {
19460 fn default() -> Self {
19461 Self::DEFAULT.clone()
19462 }
19463}
19464impl MessageData for MISSION_CURRENT_DATA {
19465 type Message = MavMessage;
19466 const ID: u32 = 42u32;
19467 const NAME: &'static str = "MISSION_CURRENT";
19468 const EXTRA_CRC: u8 = 28u8;
19469 const ENCODED_LEN: usize = 18usize;
19470 fn deser(
19471 _version: MavlinkVersion,
19472 __input: &[u8],
19473 ) -> Result<Self, ::mavlink_core::error::ParserError> {
19474 let avail_len = __input.len();
19475 let mut payload_buf = [0; Self::ENCODED_LEN];
19476 let mut buf = if avail_len < Self::ENCODED_LEN {
19477 payload_buf[0..avail_len].copy_from_slice(__input);
19478 Bytes::new(&payload_buf)
19479 } else {
19480 Bytes::new(__input)
19481 };
19482 let mut __struct = Self::default();
19483 __struct.seq = buf.get_u16_le();
19484 __struct.total = buf.get_u16_le();
19485 let tmp = buf.get_u8();
19486 __struct.mission_state =
19487 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
19488 enum_type: "MissionState",
19489 value: tmp as u64,
19490 })?;
19491 __struct.mission_mode = buf.get_u8();
19492 __struct.mission_id = buf.get_u32_le();
19493 __struct.fence_id = buf.get_u32_le();
19494 __struct.rally_points_id = buf.get_u32_le();
19495 Ok(__struct)
19496 }
19497 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
19498 let mut __tmp = BytesMut::new(bytes);
19499 #[allow(clippy::absurd_extreme_comparisons)]
19500 #[allow(unused_comparisons)]
19501 if __tmp.remaining() < Self::ENCODED_LEN {
19502 panic!(
19503 "buffer is too small (need {} bytes, but got {})",
19504 Self::ENCODED_LEN,
19505 __tmp.remaining(),
19506 )
19507 }
19508 __tmp.put_u16_le(self.seq);
19509 if matches!(version, MavlinkVersion::V2) {
19510 __tmp.put_u16_le(self.total);
19511 __tmp.put_u8(self.mission_state as u8);
19512 __tmp.put_u8(self.mission_mode);
19513 __tmp.put_u32_le(self.mission_id);
19514 __tmp.put_u32_le(self.fence_id);
19515 __tmp.put_u32_le(self.rally_points_id);
19516 let len = __tmp.len();
19517 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
19518 } else {
19519 __tmp.len()
19520 }
19521 }
19522}
19523#[deprecated = " See `MISSION_ITEM_INT` (Deprecated since 2020-06)"]
19524#[doc = "Message encoding a mission item. This message is emitted to announce the presence of a mission item and to set a mission item on the system. The mission item can be either in x, y, z meters (type: LOCAL) or x:lat, y:lon, z:altitude. Local frame is Z-down, right handed (NED), global frame is Z-up, right handed (ENU). NaN may be used to indicate an optional/default value (e.g. to use the system's current latitude or yaw rather than a specific value). See also <https://mavlink.io/en/services/mission.html>."]
19525#[doc = ""]
19526#[doc = "ID: 39"]
19527#[derive(Debug, Clone, PartialEq)]
19528#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
19529#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
19530#[cfg_attr(feature = "ts", derive(TS))]
19531#[cfg_attr(feature = "ts", ts(export))]
19532pub struct MISSION_ITEM_DATA {
19533 #[doc = "PARAM1, see MAV_CMD enum"]
19534 pub param1: f32,
19535 #[doc = "PARAM2, see MAV_CMD enum"]
19536 pub param2: f32,
19537 #[doc = "PARAM3, see MAV_CMD enum"]
19538 pub param3: f32,
19539 #[doc = "PARAM4, see MAV_CMD enum"]
19540 pub param4: f32,
19541 #[doc = "PARAM5 / local: X coordinate, global: latitude"]
19542 pub x: f32,
19543 #[doc = "PARAM6 / local: Y coordinate, global: longitude"]
19544 pub y: f32,
19545 #[doc = "PARAM7 / local: Z coordinate, global: altitude (relative or absolute, depending on frame)."]
19546 pub z: f32,
19547 #[doc = "Sequence"]
19548 pub seq: u16,
19549 #[doc = "The scheduled action for the waypoint."]
19550 pub command: MavCmd,
19551 #[doc = "System ID"]
19552 pub target_system: u8,
19553 #[doc = "Component ID"]
19554 pub target_component: u8,
19555 #[doc = "The coordinate system of the waypoint."]
19556 pub frame: MavFrame,
19557 #[doc = "false:0, true:1"]
19558 pub current: u8,
19559 #[doc = "Autocontinue to next waypoint. 0: false, 1: true. Set false to pause mission after the item completes."]
19560 pub autocontinue: u8,
19561 #[doc = "Mission type."]
19562 #[cfg_attr(feature = "serde", serde(default))]
19563 pub mission_type: MavMissionType,
19564}
19565impl MISSION_ITEM_DATA {
19566 pub const ENCODED_LEN: usize = 38usize;
19567 pub const DEFAULT: Self = Self {
19568 param1: 0.0_f32,
19569 param2: 0.0_f32,
19570 param3: 0.0_f32,
19571 param4: 0.0_f32,
19572 x: 0.0_f32,
19573 y: 0.0_f32,
19574 z: 0.0_f32,
19575 seq: 0_u16,
19576 command: MavCmd::DEFAULT,
19577 target_system: 0_u8,
19578 target_component: 0_u8,
19579 frame: MavFrame::DEFAULT,
19580 current: 0_u8,
19581 autocontinue: 0_u8,
19582 mission_type: MavMissionType::DEFAULT,
19583 };
19584 #[cfg(feature = "arbitrary")]
19585 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
19586 use arbitrary::{Arbitrary, Unstructured};
19587 let mut buf = [0u8; 1024];
19588 rng.fill_bytes(&mut buf);
19589 let mut unstructured = Unstructured::new(&buf);
19590 Self::arbitrary(&mut unstructured).unwrap_or_default()
19591 }
19592}
19593impl Default for MISSION_ITEM_DATA {
19594 fn default() -> Self {
19595 Self::DEFAULT.clone()
19596 }
19597}
19598impl MessageData for MISSION_ITEM_DATA {
19599 type Message = MavMessage;
19600 const ID: u32 = 39u32;
19601 const NAME: &'static str = "MISSION_ITEM";
19602 const EXTRA_CRC: u8 = 254u8;
19603 const ENCODED_LEN: usize = 38usize;
19604 fn deser(
19605 _version: MavlinkVersion,
19606 __input: &[u8],
19607 ) -> Result<Self, ::mavlink_core::error::ParserError> {
19608 let avail_len = __input.len();
19609 let mut payload_buf = [0; Self::ENCODED_LEN];
19610 let mut buf = if avail_len < Self::ENCODED_LEN {
19611 payload_buf[0..avail_len].copy_from_slice(__input);
19612 Bytes::new(&payload_buf)
19613 } else {
19614 Bytes::new(__input)
19615 };
19616 let mut __struct = Self::default();
19617 __struct.param1 = buf.get_f32_le();
19618 __struct.param2 = buf.get_f32_le();
19619 __struct.param3 = buf.get_f32_le();
19620 __struct.param4 = buf.get_f32_le();
19621 __struct.x = buf.get_f32_le();
19622 __struct.y = buf.get_f32_le();
19623 __struct.z = buf.get_f32_le();
19624 __struct.seq = buf.get_u16_le();
19625 let tmp = buf.get_u16_le();
19626 __struct.command = FromPrimitive::from_u16(tmp).ok_or(
19627 ::mavlink_core::error::ParserError::InvalidEnum {
19628 enum_type: "MavCmd",
19629 value: tmp as u64,
19630 },
19631 )?;
19632 __struct.target_system = buf.get_u8();
19633 __struct.target_component = buf.get_u8();
19634 let tmp = buf.get_u8();
19635 __struct.frame =
19636 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
19637 enum_type: "MavFrame",
19638 value: tmp as u64,
19639 })?;
19640 __struct.current = buf.get_u8();
19641 __struct.autocontinue = buf.get_u8();
19642 let tmp = buf.get_u8();
19643 __struct.mission_type =
19644 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
19645 enum_type: "MavMissionType",
19646 value: tmp as u64,
19647 })?;
19648 Ok(__struct)
19649 }
19650 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
19651 let mut __tmp = BytesMut::new(bytes);
19652 #[allow(clippy::absurd_extreme_comparisons)]
19653 #[allow(unused_comparisons)]
19654 if __tmp.remaining() < Self::ENCODED_LEN {
19655 panic!(
19656 "buffer is too small (need {} bytes, but got {})",
19657 Self::ENCODED_LEN,
19658 __tmp.remaining(),
19659 )
19660 }
19661 __tmp.put_f32_le(self.param1);
19662 __tmp.put_f32_le(self.param2);
19663 __tmp.put_f32_le(self.param3);
19664 __tmp.put_f32_le(self.param4);
19665 __tmp.put_f32_le(self.x);
19666 __tmp.put_f32_le(self.y);
19667 __tmp.put_f32_le(self.z);
19668 __tmp.put_u16_le(self.seq);
19669 __tmp.put_u16_le(self.command as u16);
19670 __tmp.put_u8(self.target_system);
19671 __tmp.put_u8(self.target_component);
19672 __tmp.put_u8(self.frame as u8);
19673 __tmp.put_u8(self.current);
19674 __tmp.put_u8(self.autocontinue);
19675 if matches!(version, MavlinkVersion::V2) {
19676 __tmp.put_u8(self.mission_type as u8);
19677 let len = __tmp.len();
19678 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
19679 } else {
19680 __tmp.len()
19681 }
19682 }
19683}
19684#[doc = "Message encoding a mission item. This message is emitted to announce the presence of a mission item and to set a mission item on the system. The mission item can be either in x, y, z meters (type: LOCAL) or x:lat, y:lon, z:altitude. Local frame is Z-down, right handed (NED), global frame is Z-up, right handed (ENU). NaN or INT32_MAX may be used in float/integer params (respectively) to indicate optional/default values (e.g. to use the component's current latitude, yaw rather than a specific value). See also <https://mavlink.io/en/services/mission.html>."]
19685#[doc = ""]
19686#[doc = "ID: 73"]
19687#[derive(Debug, Clone, PartialEq)]
19688#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
19689#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
19690#[cfg_attr(feature = "ts", derive(TS))]
19691#[cfg_attr(feature = "ts", ts(export))]
19692pub struct MISSION_ITEM_INT_DATA {
19693 #[doc = "PARAM1, see MAV_CMD enum"]
19694 pub param1: f32,
19695 #[doc = "PARAM2, see MAV_CMD enum"]
19696 pub param2: f32,
19697 #[doc = "PARAM3, see MAV_CMD enum"]
19698 pub param3: f32,
19699 #[doc = "PARAM4, see MAV_CMD enum"]
19700 pub param4: f32,
19701 #[doc = "PARAM5 / local: x position in meters * 1e4, global: latitude in degrees * 10^7"]
19702 pub x: i32,
19703 #[doc = "PARAM6 / y position: local: x position in meters * 1e4, global: longitude in degrees *10^7"]
19704 pub y: i32,
19705 #[doc = "PARAM7 / z position: global: altitude in meters (relative or absolute, depending on frame."]
19706 pub z: f32,
19707 #[doc = "Waypoint ID (sequence number). Starts at zero. Increases monotonically for each waypoint, no gaps in the sequence (0,1,2,3,4)."]
19708 pub seq: u16,
19709 #[doc = "The scheduled action for the waypoint."]
19710 pub command: MavCmd,
19711 #[doc = "System ID"]
19712 pub target_system: u8,
19713 #[doc = "Component ID"]
19714 pub target_component: u8,
19715 #[doc = "The coordinate system of the waypoint."]
19716 pub frame: MavFrame,
19717 #[doc = "false:0, true:1"]
19718 pub current: u8,
19719 #[doc = "Autocontinue to next waypoint. 0: false, 1: true. Set false to pause mission after the item completes."]
19720 pub autocontinue: u8,
19721 #[doc = "Mission type."]
19722 #[cfg_attr(feature = "serde", serde(default))]
19723 pub mission_type: MavMissionType,
19724}
19725impl MISSION_ITEM_INT_DATA {
19726 pub const ENCODED_LEN: usize = 38usize;
19727 pub const DEFAULT: Self = Self {
19728 param1: 0.0_f32,
19729 param2: 0.0_f32,
19730 param3: 0.0_f32,
19731 param4: 0.0_f32,
19732 x: 0_i32,
19733 y: 0_i32,
19734 z: 0.0_f32,
19735 seq: 0_u16,
19736 command: MavCmd::DEFAULT,
19737 target_system: 0_u8,
19738 target_component: 0_u8,
19739 frame: MavFrame::DEFAULT,
19740 current: 0_u8,
19741 autocontinue: 0_u8,
19742 mission_type: MavMissionType::DEFAULT,
19743 };
19744 #[cfg(feature = "arbitrary")]
19745 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
19746 use arbitrary::{Arbitrary, Unstructured};
19747 let mut buf = [0u8; 1024];
19748 rng.fill_bytes(&mut buf);
19749 let mut unstructured = Unstructured::new(&buf);
19750 Self::arbitrary(&mut unstructured).unwrap_or_default()
19751 }
19752}
19753impl Default for MISSION_ITEM_INT_DATA {
19754 fn default() -> Self {
19755 Self::DEFAULT.clone()
19756 }
19757}
19758impl MessageData for MISSION_ITEM_INT_DATA {
19759 type Message = MavMessage;
19760 const ID: u32 = 73u32;
19761 const NAME: &'static str = "MISSION_ITEM_INT";
19762 const EXTRA_CRC: u8 = 38u8;
19763 const ENCODED_LEN: usize = 38usize;
19764 fn deser(
19765 _version: MavlinkVersion,
19766 __input: &[u8],
19767 ) -> Result<Self, ::mavlink_core::error::ParserError> {
19768 let avail_len = __input.len();
19769 let mut payload_buf = [0; Self::ENCODED_LEN];
19770 let mut buf = if avail_len < Self::ENCODED_LEN {
19771 payload_buf[0..avail_len].copy_from_slice(__input);
19772 Bytes::new(&payload_buf)
19773 } else {
19774 Bytes::new(__input)
19775 };
19776 let mut __struct = Self::default();
19777 __struct.param1 = buf.get_f32_le();
19778 __struct.param2 = buf.get_f32_le();
19779 __struct.param3 = buf.get_f32_le();
19780 __struct.param4 = buf.get_f32_le();
19781 __struct.x = buf.get_i32_le();
19782 __struct.y = buf.get_i32_le();
19783 __struct.z = buf.get_f32_le();
19784 __struct.seq = buf.get_u16_le();
19785 let tmp = buf.get_u16_le();
19786 __struct.command = FromPrimitive::from_u16(tmp).ok_or(
19787 ::mavlink_core::error::ParserError::InvalidEnum {
19788 enum_type: "MavCmd",
19789 value: tmp as u64,
19790 },
19791 )?;
19792 __struct.target_system = buf.get_u8();
19793 __struct.target_component = buf.get_u8();
19794 let tmp = buf.get_u8();
19795 __struct.frame =
19796 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
19797 enum_type: "MavFrame",
19798 value: tmp as u64,
19799 })?;
19800 __struct.current = buf.get_u8();
19801 __struct.autocontinue = buf.get_u8();
19802 let tmp = buf.get_u8();
19803 __struct.mission_type =
19804 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
19805 enum_type: "MavMissionType",
19806 value: tmp as u64,
19807 })?;
19808 Ok(__struct)
19809 }
19810 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
19811 let mut __tmp = BytesMut::new(bytes);
19812 #[allow(clippy::absurd_extreme_comparisons)]
19813 #[allow(unused_comparisons)]
19814 if __tmp.remaining() < Self::ENCODED_LEN {
19815 panic!(
19816 "buffer is too small (need {} bytes, but got {})",
19817 Self::ENCODED_LEN,
19818 __tmp.remaining(),
19819 )
19820 }
19821 __tmp.put_f32_le(self.param1);
19822 __tmp.put_f32_le(self.param2);
19823 __tmp.put_f32_le(self.param3);
19824 __tmp.put_f32_le(self.param4);
19825 __tmp.put_i32_le(self.x);
19826 __tmp.put_i32_le(self.y);
19827 __tmp.put_f32_le(self.z);
19828 __tmp.put_u16_le(self.seq);
19829 __tmp.put_u16_le(self.command as u16);
19830 __tmp.put_u8(self.target_system);
19831 __tmp.put_u8(self.target_component);
19832 __tmp.put_u8(self.frame as u8);
19833 __tmp.put_u8(self.current);
19834 __tmp.put_u8(self.autocontinue);
19835 if matches!(version, MavlinkVersion::V2) {
19836 __tmp.put_u8(self.mission_type as u8);
19837 let len = __tmp.len();
19838 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
19839 } else {
19840 __tmp.len()
19841 }
19842 }
19843}
19844#[doc = "A certain mission item has been reached. The system will either hold this position (or circle on the orbit) or (if the autocontinue on the WP was set) continue to the next waypoint."]
19845#[doc = ""]
19846#[doc = "ID: 46"]
19847#[derive(Debug, Clone, PartialEq)]
19848#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
19849#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
19850#[cfg_attr(feature = "ts", derive(TS))]
19851#[cfg_attr(feature = "ts", ts(export))]
19852pub struct MISSION_ITEM_REACHED_DATA {
19853 #[doc = "Sequence"]
19854 pub seq: u16,
19855}
19856impl MISSION_ITEM_REACHED_DATA {
19857 pub const ENCODED_LEN: usize = 2usize;
19858 pub const DEFAULT: Self = Self { seq: 0_u16 };
19859 #[cfg(feature = "arbitrary")]
19860 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
19861 use arbitrary::{Arbitrary, Unstructured};
19862 let mut buf = [0u8; 1024];
19863 rng.fill_bytes(&mut buf);
19864 let mut unstructured = Unstructured::new(&buf);
19865 Self::arbitrary(&mut unstructured).unwrap_or_default()
19866 }
19867}
19868impl Default for MISSION_ITEM_REACHED_DATA {
19869 fn default() -> Self {
19870 Self::DEFAULT.clone()
19871 }
19872}
19873impl MessageData for MISSION_ITEM_REACHED_DATA {
19874 type Message = MavMessage;
19875 const ID: u32 = 46u32;
19876 const NAME: &'static str = "MISSION_ITEM_REACHED";
19877 const EXTRA_CRC: u8 = 11u8;
19878 const ENCODED_LEN: usize = 2usize;
19879 fn deser(
19880 _version: MavlinkVersion,
19881 __input: &[u8],
19882 ) -> Result<Self, ::mavlink_core::error::ParserError> {
19883 let avail_len = __input.len();
19884 let mut payload_buf = [0; Self::ENCODED_LEN];
19885 let mut buf = if avail_len < Self::ENCODED_LEN {
19886 payload_buf[0..avail_len].copy_from_slice(__input);
19887 Bytes::new(&payload_buf)
19888 } else {
19889 Bytes::new(__input)
19890 };
19891 let mut __struct = Self::default();
19892 __struct.seq = buf.get_u16_le();
19893 Ok(__struct)
19894 }
19895 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
19896 let mut __tmp = BytesMut::new(bytes);
19897 #[allow(clippy::absurd_extreme_comparisons)]
19898 #[allow(unused_comparisons)]
19899 if __tmp.remaining() < Self::ENCODED_LEN {
19900 panic!(
19901 "buffer is too small (need {} bytes, but got {})",
19902 Self::ENCODED_LEN,
19903 __tmp.remaining(),
19904 )
19905 }
19906 __tmp.put_u16_le(self.seq);
19907 if matches!(version, MavlinkVersion::V2) {
19908 let len = __tmp.len();
19909 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
19910 } else {
19911 __tmp.len()
19912 }
19913 }
19914}
19915#[deprecated = "A system that gets this request should respond with MISSION_ITEM_INT (as though MISSION_REQUEST_INT was received). See `MISSION_REQUEST_INT` (Deprecated since 2020-06)"]
19916#[doc = "Request the information of the mission item with the sequence number seq. The response of the system to this message should be a MISSION_ITEM message. <https://mavlink.io/en/services/mission.html>."]
19917#[doc = ""]
19918#[doc = "ID: 40"]
19919#[derive(Debug, Clone, PartialEq)]
19920#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
19921#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
19922#[cfg_attr(feature = "ts", derive(TS))]
19923#[cfg_attr(feature = "ts", ts(export))]
19924pub struct MISSION_REQUEST_DATA {
19925 #[doc = "Sequence"]
19926 pub seq: u16,
19927 #[doc = "System ID"]
19928 pub target_system: u8,
19929 #[doc = "Component ID"]
19930 pub target_component: u8,
19931 #[doc = "Mission type."]
19932 #[cfg_attr(feature = "serde", serde(default))]
19933 pub mission_type: MavMissionType,
19934}
19935impl MISSION_REQUEST_DATA {
19936 pub const ENCODED_LEN: usize = 5usize;
19937 pub const DEFAULT: Self = Self {
19938 seq: 0_u16,
19939 target_system: 0_u8,
19940 target_component: 0_u8,
19941 mission_type: MavMissionType::DEFAULT,
19942 };
19943 #[cfg(feature = "arbitrary")]
19944 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
19945 use arbitrary::{Arbitrary, Unstructured};
19946 let mut buf = [0u8; 1024];
19947 rng.fill_bytes(&mut buf);
19948 let mut unstructured = Unstructured::new(&buf);
19949 Self::arbitrary(&mut unstructured).unwrap_or_default()
19950 }
19951}
19952impl Default for MISSION_REQUEST_DATA {
19953 fn default() -> Self {
19954 Self::DEFAULT.clone()
19955 }
19956}
19957impl MessageData for MISSION_REQUEST_DATA {
19958 type Message = MavMessage;
19959 const ID: u32 = 40u32;
19960 const NAME: &'static str = "MISSION_REQUEST";
19961 const EXTRA_CRC: u8 = 230u8;
19962 const ENCODED_LEN: usize = 5usize;
19963 fn deser(
19964 _version: MavlinkVersion,
19965 __input: &[u8],
19966 ) -> Result<Self, ::mavlink_core::error::ParserError> {
19967 let avail_len = __input.len();
19968 let mut payload_buf = [0; Self::ENCODED_LEN];
19969 let mut buf = if avail_len < Self::ENCODED_LEN {
19970 payload_buf[0..avail_len].copy_from_slice(__input);
19971 Bytes::new(&payload_buf)
19972 } else {
19973 Bytes::new(__input)
19974 };
19975 let mut __struct = Self::default();
19976 __struct.seq = buf.get_u16_le();
19977 __struct.target_system = buf.get_u8();
19978 __struct.target_component = buf.get_u8();
19979 let tmp = buf.get_u8();
19980 __struct.mission_type =
19981 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
19982 enum_type: "MavMissionType",
19983 value: tmp as u64,
19984 })?;
19985 Ok(__struct)
19986 }
19987 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
19988 let mut __tmp = BytesMut::new(bytes);
19989 #[allow(clippy::absurd_extreme_comparisons)]
19990 #[allow(unused_comparisons)]
19991 if __tmp.remaining() < Self::ENCODED_LEN {
19992 panic!(
19993 "buffer is too small (need {} bytes, but got {})",
19994 Self::ENCODED_LEN,
19995 __tmp.remaining(),
19996 )
19997 }
19998 __tmp.put_u16_le(self.seq);
19999 __tmp.put_u8(self.target_system);
20000 __tmp.put_u8(self.target_component);
20001 if matches!(version, MavlinkVersion::V2) {
20002 __tmp.put_u8(self.mission_type as u8);
20003 let len = __tmp.len();
20004 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
20005 } else {
20006 __tmp.len()
20007 }
20008 }
20009}
20010#[doc = "Request the information of the mission item with the sequence number seq. The response of the system to this message should be a MISSION_ITEM_INT message. <https://mavlink.io/en/services/mission.html>."]
20011#[doc = ""]
20012#[doc = "ID: 51"]
20013#[derive(Debug, Clone, PartialEq)]
20014#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
20015#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
20016#[cfg_attr(feature = "ts", derive(TS))]
20017#[cfg_attr(feature = "ts", ts(export))]
20018pub struct MISSION_REQUEST_INT_DATA {
20019 #[doc = "Sequence"]
20020 pub seq: u16,
20021 #[doc = "System ID"]
20022 pub target_system: u8,
20023 #[doc = "Component ID"]
20024 pub target_component: u8,
20025 #[doc = "Mission type."]
20026 #[cfg_attr(feature = "serde", serde(default))]
20027 pub mission_type: MavMissionType,
20028}
20029impl MISSION_REQUEST_INT_DATA {
20030 pub const ENCODED_LEN: usize = 5usize;
20031 pub const DEFAULT: Self = Self {
20032 seq: 0_u16,
20033 target_system: 0_u8,
20034 target_component: 0_u8,
20035 mission_type: MavMissionType::DEFAULT,
20036 };
20037 #[cfg(feature = "arbitrary")]
20038 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
20039 use arbitrary::{Arbitrary, Unstructured};
20040 let mut buf = [0u8; 1024];
20041 rng.fill_bytes(&mut buf);
20042 let mut unstructured = Unstructured::new(&buf);
20043 Self::arbitrary(&mut unstructured).unwrap_or_default()
20044 }
20045}
20046impl Default for MISSION_REQUEST_INT_DATA {
20047 fn default() -> Self {
20048 Self::DEFAULT.clone()
20049 }
20050}
20051impl MessageData for MISSION_REQUEST_INT_DATA {
20052 type Message = MavMessage;
20053 const ID: u32 = 51u32;
20054 const NAME: &'static str = "MISSION_REQUEST_INT";
20055 const EXTRA_CRC: u8 = 196u8;
20056 const ENCODED_LEN: usize = 5usize;
20057 fn deser(
20058 _version: MavlinkVersion,
20059 __input: &[u8],
20060 ) -> Result<Self, ::mavlink_core::error::ParserError> {
20061 let avail_len = __input.len();
20062 let mut payload_buf = [0; Self::ENCODED_LEN];
20063 let mut buf = if avail_len < Self::ENCODED_LEN {
20064 payload_buf[0..avail_len].copy_from_slice(__input);
20065 Bytes::new(&payload_buf)
20066 } else {
20067 Bytes::new(__input)
20068 };
20069 let mut __struct = Self::default();
20070 __struct.seq = buf.get_u16_le();
20071 __struct.target_system = buf.get_u8();
20072 __struct.target_component = buf.get_u8();
20073 let tmp = buf.get_u8();
20074 __struct.mission_type =
20075 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
20076 enum_type: "MavMissionType",
20077 value: tmp as u64,
20078 })?;
20079 Ok(__struct)
20080 }
20081 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
20082 let mut __tmp = BytesMut::new(bytes);
20083 #[allow(clippy::absurd_extreme_comparisons)]
20084 #[allow(unused_comparisons)]
20085 if __tmp.remaining() < Self::ENCODED_LEN {
20086 panic!(
20087 "buffer is too small (need {} bytes, but got {})",
20088 Self::ENCODED_LEN,
20089 __tmp.remaining(),
20090 )
20091 }
20092 __tmp.put_u16_le(self.seq);
20093 __tmp.put_u8(self.target_system);
20094 __tmp.put_u8(self.target_component);
20095 if matches!(version, MavlinkVersion::V2) {
20096 __tmp.put_u8(self.mission_type as u8);
20097 let len = __tmp.len();
20098 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
20099 } else {
20100 __tmp.len()
20101 }
20102 }
20103}
20104#[doc = "Request the overall list of mission items from the system/component."]
20105#[doc = ""]
20106#[doc = "ID: 43"]
20107#[derive(Debug, Clone, PartialEq)]
20108#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
20109#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
20110#[cfg_attr(feature = "ts", derive(TS))]
20111#[cfg_attr(feature = "ts", ts(export))]
20112pub struct MISSION_REQUEST_LIST_DATA {
20113 #[doc = "System ID"]
20114 pub target_system: u8,
20115 #[doc = "Component ID"]
20116 pub target_component: u8,
20117 #[doc = "Mission type."]
20118 #[cfg_attr(feature = "serde", serde(default))]
20119 pub mission_type: MavMissionType,
20120}
20121impl MISSION_REQUEST_LIST_DATA {
20122 pub const ENCODED_LEN: usize = 3usize;
20123 pub const DEFAULT: Self = Self {
20124 target_system: 0_u8,
20125 target_component: 0_u8,
20126 mission_type: MavMissionType::DEFAULT,
20127 };
20128 #[cfg(feature = "arbitrary")]
20129 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
20130 use arbitrary::{Arbitrary, Unstructured};
20131 let mut buf = [0u8; 1024];
20132 rng.fill_bytes(&mut buf);
20133 let mut unstructured = Unstructured::new(&buf);
20134 Self::arbitrary(&mut unstructured).unwrap_or_default()
20135 }
20136}
20137impl Default for MISSION_REQUEST_LIST_DATA {
20138 fn default() -> Self {
20139 Self::DEFAULT.clone()
20140 }
20141}
20142impl MessageData for MISSION_REQUEST_LIST_DATA {
20143 type Message = MavMessage;
20144 const ID: u32 = 43u32;
20145 const NAME: &'static str = "MISSION_REQUEST_LIST";
20146 const EXTRA_CRC: u8 = 132u8;
20147 const ENCODED_LEN: usize = 3usize;
20148 fn deser(
20149 _version: MavlinkVersion,
20150 __input: &[u8],
20151 ) -> Result<Self, ::mavlink_core::error::ParserError> {
20152 let avail_len = __input.len();
20153 let mut payload_buf = [0; Self::ENCODED_LEN];
20154 let mut buf = if avail_len < Self::ENCODED_LEN {
20155 payload_buf[0..avail_len].copy_from_slice(__input);
20156 Bytes::new(&payload_buf)
20157 } else {
20158 Bytes::new(__input)
20159 };
20160 let mut __struct = Self::default();
20161 __struct.target_system = buf.get_u8();
20162 __struct.target_component = buf.get_u8();
20163 let tmp = buf.get_u8();
20164 __struct.mission_type =
20165 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
20166 enum_type: "MavMissionType",
20167 value: tmp as u64,
20168 })?;
20169 Ok(__struct)
20170 }
20171 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
20172 let mut __tmp = BytesMut::new(bytes);
20173 #[allow(clippy::absurd_extreme_comparisons)]
20174 #[allow(unused_comparisons)]
20175 if __tmp.remaining() < Self::ENCODED_LEN {
20176 panic!(
20177 "buffer is too small (need {} bytes, but got {})",
20178 Self::ENCODED_LEN,
20179 __tmp.remaining(),
20180 )
20181 }
20182 __tmp.put_u8(self.target_system);
20183 __tmp.put_u8(self.target_component);
20184 if matches!(version, MavlinkVersion::V2) {
20185 __tmp.put_u8(self.mission_type as u8);
20186 let len = __tmp.len();
20187 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
20188 } else {
20189 __tmp.len()
20190 }
20191 }
20192}
20193#[doc = "Request a partial list of mission items from the system/component. <https://mavlink.io/en/services/mission.html>. If start and end index are the same, just send one waypoint."]
20194#[doc = ""]
20195#[doc = "ID: 37"]
20196#[derive(Debug, Clone, PartialEq)]
20197#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
20198#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
20199#[cfg_attr(feature = "ts", derive(TS))]
20200#[cfg_attr(feature = "ts", ts(export))]
20201pub struct MISSION_REQUEST_PARTIAL_LIST_DATA {
20202 #[doc = "Start index"]
20203 pub start_index: i16,
20204 #[doc = "End index, -1 by default (-1: send list to end). Else a valid index of the list"]
20205 pub end_index: i16,
20206 #[doc = "System ID"]
20207 pub target_system: u8,
20208 #[doc = "Component ID"]
20209 pub target_component: u8,
20210 #[doc = "Mission type."]
20211 #[cfg_attr(feature = "serde", serde(default))]
20212 pub mission_type: MavMissionType,
20213}
20214impl MISSION_REQUEST_PARTIAL_LIST_DATA {
20215 pub const ENCODED_LEN: usize = 7usize;
20216 pub const DEFAULT: Self = Self {
20217 start_index: 0_i16,
20218 end_index: 0_i16,
20219 target_system: 0_u8,
20220 target_component: 0_u8,
20221 mission_type: MavMissionType::DEFAULT,
20222 };
20223 #[cfg(feature = "arbitrary")]
20224 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
20225 use arbitrary::{Arbitrary, Unstructured};
20226 let mut buf = [0u8; 1024];
20227 rng.fill_bytes(&mut buf);
20228 let mut unstructured = Unstructured::new(&buf);
20229 Self::arbitrary(&mut unstructured).unwrap_or_default()
20230 }
20231}
20232impl Default for MISSION_REQUEST_PARTIAL_LIST_DATA {
20233 fn default() -> Self {
20234 Self::DEFAULT.clone()
20235 }
20236}
20237impl MessageData for MISSION_REQUEST_PARTIAL_LIST_DATA {
20238 type Message = MavMessage;
20239 const ID: u32 = 37u32;
20240 const NAME: &'static str = "MISSION_REQUEST_PARTIAL_LIST";
20241 const EXTRA_CRC: u8 = 212u8;
20242 const ENCODED_LEN: usize = 7usize;
20243 fn deser(
20244 _version: MavlinkVersion,
20245 __input: &[u8],
20246 ) -> Result<Self, ::mavlink_core::error::ParserError> {
20247 let avail_len = __input.len();
20248 let mut payload_buf = [0; Self::ENCODED_LEN];
20249 let mut buf = if avail_len < Self::ENCODED_LEN {
20250 payload_buf[0..avail_len].copy_from_slice(__input);
20251 Bytes::new(&payload_buf)
20252 } else {
20253 Bytes::new(__input)
20254 };
20255 let mut __struct = Self::default();
20256 __struct.start_index = buf.get_i16_le();
20257 __struct.end_index = buf.get_i16_le();
20258 __struct.target_system = buf.get_u8();
20259 __struct.target_component = buf.get_u8();
20260 let tmp = buf.get_u8();
20261 __struct.mission_type =
20262 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
20263 enum_type: "MavMissionType",
20264 value: tmp as u64,
20265 })?;
20266 Ok(__struct)
20267 }
20268 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
20269 let mut __tmp = BytesMut::new(bytes);
20270 #[allow(clippy::absurd_extreme_comparisons)]
20271 #[allow(unused_comparisons)]
20272 if __tmp.remaining() < Self::ENCODED_LEN {
20273 panic!(
20274 "buffer is too small (need {} bytes, but got {})",
20275 Self::ENCODED_LEN,
20276 __tmp.remaining(),
20277 )
20278 }
20279 __tmp.put_i16_le(self.start_index);
20280 __tmp.put_i16_le(self.end_index);
20281 __tmp.put_u8(self.target_system);
20282 __tmp.put_u8(self.target_component);
20283 if matches!(version, MavlinkVersion::V2) {
20284 __tmp.put_u8(self.mission_type as u8);
20285 let len = __tmp.len();
20286 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
20287 } else {
20288 __tmp.len()
20289 }
20290 }
20291}
20292#[deprecated = " See `MAV_CMD_DO_SET_MISSION_CURRENT` (Deprecated since 2022-08)"]
20293#[doc = "Set the mission item with sequence number seq as the current item and emit MISSION_CURRENT (whether or not the mission number changed). If a mission is currently being executed, the system will continue to this new mission item on the shortest path, skipping any intermediate mission items. Note that mission jump repeat counters are not reset (see MAV_CMD_DO_JUMP param2). This message may trigger a mission state-machine change on some systems: for example from MISSION_STATE_NOT_STARTED or MISSION_STATE_PAUSED to MISSION_STATE_ACTIVE. If the system is in mission mode, on those systems this command might therefore start, restart or resume the mission. If the system is not in mission mode this message must not trigger a switch to mission mode."]
20294#[doc = ""]
20295#[doc = "ID: 41"]
20296#[derive(Debug, Clone, PartialEq)]
20297#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
20298#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
20299#[cfg_attr(feature = "ts", derive(TS))]
20300#[cfg_attr(feature = "ts", ts(export))]
20301pub struct MISSION_SET_CURRENT_DATA {
20302 #[doc = "Sequence"]
20303 pub seq: u16,
20304 #[doc = "System ID"]
20305 pub target_system: u8,
20306 #[doc = "Component ID"]
20307 pub target_component: u8,
20308}
20309impl MISSION_SET_CURRENT_DATA {
20310 pub const ENCODED_LEN: usize = 4usize;
20311 pub const DEFAULT: Self = Self {
20312 seq: 0_u16,
20313 target_system: 0_u8,
20314 target_component: 0_u8,
20315 };
20316 #[cfg(feature = "arbitrary")]
20317 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
20318 use arbitrary::{Arbitrary, Unstructured};
20319 let mut buf = [0u8; 1024];
20320 rng.fill_bytes(&mut buf);
20321 let mut unstructured = Unstructured::new(&buf);
20322 Self::arbitrary(&mut unstructured).unwrap_or_default()
20323 }
20324}
20325impl Default for MISSION_SET_CURRENT_DATA {
20326 fn default() -> Self {
20327 Self::DEFAULT.clone()
20328 }
20329}
20330impl MessageData for MISSION_SET_CURRENT_DATA {
20331 type Message = MavMessage;
20332 const ID: u32 = 41u32;
20333 const NAME: &'static str = "MISSION_SET_CURRENT";
20334 const EXTRA_CRC: u8 = 28u8;
20335 const ENCODED_LEN: usize = 4usize;
20336 fn deser(
20337 _version: MavlinkVersion,
20338 __input: &[u8],
20339 ) -> Result<Self, ::mavlink_core::error::ParserError> {
20340 let avail_len = __input.len();
20341 let mut payload_buf = [0; Self::ENCODED_LEN];
20342 let mut buf = if avail_len < Self::ENCODED_LEN {
20343 payload_buf[0..avail_len].copy_from_slice(__input);
20344 Bytes::new(&payload_buf)
20345 } else {
20346 Bytes::new(__input)
20347 };
20348 let mut __struct = Self::default();
20349 __struct.seq = buf.get_u16_le();
20350 __struct.target_system = buf.get_u8();
20351 __struct.target_component = buf.get_u8();
20352 Ok(__struct)
20353 }
20354 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
20355 let mut __tmp = BytesMut::new(bytes);
20356 #[allow(clippy::absurd_extreme_comparisons)]
20357 #[allow(unused_comparisons)]
20358 if __tmp.remaining() < Self::ENCODED_LEN {
20359 panic!(
20360 "buffer is too small (need {} bytes, but got {})",
20361 Self::ENCODED_LEN,
20362 __tmp.remaining(),
20363 )
20364 }
20365 __tmp.put_u16_le(self.seq);
20366 __tmp.put_u8(self.target_system);
20367 __tmp.put_u8(self.target_component);
20368 if matches!(version, MavlinkVersion::V2) {
20369 let len = __tmp.len();
20370 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
20371 } else {
20372 __tmp.len()
20373 }
20374 }
20375}
20376#[doc = "This message is sent to the MAV to write a partial list. If start index == end index, only one item will be transmitted / updated. If the start index is NOT 0 and above the current list size, this request should be REJECTED!."]
20377#[doc = ""]
20378#[doc = "ID: 38"]
20379#[derive(Debug, Clone, PartialEq)]
20380#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
20381#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
20382#[cfg_attr(feature = "ts", derive(TS))]
20383#[cfg_attr(feature = "ts", ts(export))]
20384pub struct MISSION_WRITE_PARTIAL_LIST_DATA {
20385 #[doc = "Start index. Must be smaller / equal to the largest index of the current onboard list."]
20386 pub start_index: i16,
20387 #[doc = "End index, equal or greater than start index."]
20388 pub end_index: i16,
20389 #[doc = "System ID"]
20390 pub target_system: u8,
20391 #[doc = "Component ID"]
20392 pub target_component: u8,
20393 #[doc = "Mission type."]
20394 #[cfg_attr(feature = "serde", serde(default))]
20395 pub mission_type: MavMissionType,
20396}
20397impl MISSION_WRITE_PARTIAL_LIST_DATA {
20398 pub const ENCODED_LEN: usize = 7usize;
20399 pub const DEFAULT: Self = Self {
20400 start_index: 0_i16,
20401 end_index: 0_i16,
20402 target_system: 0_u8,
20403 target_component: 0_u8,
20404 mission_type: MavMissionType::DEFAULT,
20405 };
20406 #[cfg(feature = "arbitrary")]
20407 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
20408 use arbitrary::{Arbitrary, Unstructured};
20409 let mut buf = [0u8; 1024];
20410 rng.fill_bytes(&mut buf);
20411 let mut unstructured = Unstructured::new(&buf);
20412 Self::arbitrary(&mut unstructured).unwrap_or_default()
20413 }
20414}
20415impl Default for MISSION_WRITE_PARTIAL_LIST_DATA {
20416 fn default() -> Self {
20417 Self::DEFAULT.clone()
20418 }
20419}
20420impl MessageData for MISSION_WRITE_PARTIAL_LIST_DATA {
20421 type Message = MavMessage;
20422 const ID: u32 = 38u32;
20423 const NAME: &'static str = "MISSION_WRITE_PARTIAL_LIST";
20424 const EXTRA_CRC: u8 = 9u8;
20425 const ENCODED_LEN: usize = 7usize;
20426 fn deser(
20427 _version: MavlinkVersion,
20428 __input: &[u8],
20429 ) -> Result<Self, ::mavlink_core::error::ParserError> {
20430 let avail_len = __input.len();
20431 let mut payload_buf = [0; Self::ENCODED_LEN];
20432 let mut buf = if avail_len < Self::ENCODED_LEN {
20433 payload_buf[0..avail_len].copy_from_slice(__input);
20434 Bytes::new(&payload_buf)
20435 } else {
20436 Bytes::new(__input)
20437 };
20438 let mut __struct = Self::default();
20439 __struct.start_index = buf.get_i16_le();
20440 __struct.end_index = buf.get_i16_le();
20441 __struct.target_system = buf.get_u8();
20442 __struct.target_component = buf.get_u8();
20443 let tmp = buf.get_u8();
20444 __struct.mission_type =
20445 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
20446 enum_type: "MavMissionType",
20447 value: tmp as u64,
20448 })?;
20449 Ok(__struct)
20450 }
20451 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
20452 let mut __tmp = BytesMut::new(bytes);
20453 #[allow(clippy::absurd_extreme_comparisons)]
20454 #[allow(unused_comparisons)]
20455 if __tmp.remaining() < Self::ENCODED_LEN {
20456 panic!(
20457 "buffer is too small (need {} bytes, but got {})",
20458 Self::ENCODED_LEN,
20459 __tmp.remaining(),
20460 )
20461 }
20462 __tmp.put_i16_le(self.start_index);
20463 __tmp.put_i16_le(self.end_index);
20464 __tmp.put_u8(self.target_system);
20465 __tmp.put_u8(self.target_component);
20466 if matches!(version, MavlinkVersion::V2) {
20467 __tmp.put_u8(self.mission_type as u8);
20468 let len = __tmp.len();
20469 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
20470 } else {
20471 __tmp.len()
20472 }
20473 }
20474}
20475#[deprecated = "This message is being superseded by MAV_CMD_DO_GIMBAL_MANAGER_PITCHYAW. The message can still be used to communicate with legacy gimbals implementing it. See `MAV_CMD_DO_GIMBAL_MANAGER_PITCHYAW` (Deprecated since 2020-01)"]
20476#[doc = "Orientation of a mount."]
20477#[doc = ""]
20478#[doc = "ID: 265"]
20479#[derive(Debug, Clone, PartialEq)]
20480#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
20481#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
20482#[cfg_attr(feature = "ts", derive(TS))]
20483#[cfg_attr(feature = "ts", ts(export))]
20484pub struct MOUNT_ORIENTATION_DATA {
20485 #[doc = "Timestamp (time since system boot)."]
20486 pub time_boot_ms: u32,
20487 #[doc = "Roll in global frame (set to NaN for invalid)."]
20488 pub roll: f32,
20489 #[doc = "Pitch in global frame (set to NaN for invalid)."]
20490 pub pitch: f32,
20491 #[doc = "Yaw relative to vehicle (set to NaN for invalid)."]
20492 pub yaw: f32,
20493 #[doc = "Yaw in absolute frame relative to Earth's North, north is 0 (set to NaN for invalid)."]
20494 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
20495 pub yaw_absolute: f32,
20496}
20497impl MOUNT_ORIENTATION_DATA {
20498 pub const ENCODED_LEN: usize = 20usize;
20499 pub const DEFAULT: Self = Self {
20500 time_boot_ms: 0_u32,
20501 roll: 0.0_f32,
20502 pitch: 0.0_f32,
20503 yaw: 0.0_f32,
20504 yaw_absolute: 0.0_f32,
20505 };
20506 #[cfg(feature = "arbitrary")]
20507 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
20508 use arbitrary::{Arbitrary, Unstructured};
20509 let mut buf = [0u8; 1024];
20510 rng.fill_bytes(&mut buf);
20511 let mut unstructured = Unstructured::new(&buf);
20512 Self::arbitrary(&mut unstructured).unwrap_or_default()
20513 }
20514}
20515impl Default for MOUNT_ORIENTATION_DATA {
20516 fn default() -> Self {
20517 Self::DEFAULT.clone()
20518 }
20519}
20520impl MessageData for MOUNT_ORIENTATION_DATA {
20521 type Message = MavMessage;
20522 const ID: u32 = 265u32;
20523 const NAME: &'static str = "MOUNT_ORIENTATION";
20524 const EXTRA_CRC: u8 = 26u8;
20525 const ENCODED_LEN: usize = 20usize;
20526 fn deser(
20527 _version: MavlinkVersion,
20528 __input: &[u8],
20529 ) -> Result<Self, ::mavlink_core::error::ParserError> {
20530 let avail_len = __input.len();
20531 let mut payload_buf = [0; Self::ENCODED_LEN];
20532 let mut buf = if avail_len < Self::ENCODED_LEN {
20533 payload_buf[0..avail_len].copy_from_slice(__input);
20534 Bytes::new(&payload_buf)
20535 } else {
20536 Bytes::new(__input)
20537 };
20538 let mut __struct = Self::default();
20539 __struct.time_boot_ms = buf.get_u32_le();
20540 __struct.roll = buf.get_f32_le();
20541 __struct.pitch = buf.get_f32_le();
20542 __struct.yaw = buf.get_f32_le();
20543 __struct.yaw_absolute = buf.get_f32_le();
20544 Ok(__struct)
20545 }
20546 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
20547 let mut __tmp = BytesMut::new(bytes);
20548 #[allow(clippy::absurd_extreme_comparisons)]
20549 #[allow(unused_comparisons)]
20550 if __tmp.remaining() < Self::ENCODED_LEN {
20551 panic!(
20552 "buffer is too small (need {} bytes, but got {})",
20553 Self::ENCODED_LEN,
20554 __tmp.remaining(),
20555 )
20556 }
20557 __tmp.put_u32_le(self.time_boot_ms);
20558 __tmp.put_f32_le(self.roll);
20559 __tmp.put_f32_le(self.pitch);
20560 __tmp.put_f32_le(self.yaw);
20561 if matches!(version, MavlinkVersion::V2) {
20562 __tmp.put_f32_le(self.yaw_absolute);
20563 let len = __tmp.len();
20564 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
20565 } else {
20566 __tmp.len()
20567 }
20568 }
20569}
20570#[doc = "Send a key-value pair as float. The use of this message is discouraged for normal packets, but a quite efficient way for testing new messages and getting experimental debug output."]
20571#[doc = ""]
20572#[doc = "ID: 251"]
20573#[derive(Debug, Clone, PartialEq)]
20574#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
20575#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
20576#[cfg_attr(feature = "ts", derive(TS))]
20577#[cfg_attr(feature = "ts", ts(export))]
20578pub struct NAMED_VALUE_FLOAT_DATA {
20579 #[doc = "Timestamp (time since system boot)."]
20580 pub time_boot_ms: u32,
20581 #[doc = "Floating point value"]
20582 pub value: f32,
20583 #[doc = "Name of the debug variable"]
20584 #[cfg_attr(feature = "ts", ts(type = "string"))]
20585 pub name: CharArray<10>,
20586}
20587impl NAMED_VALUE_FLOAT_DATA {
20588 pub const ENCODED_LEN: usize = 18usize;
20589 pub const DEFAULT: Self = Self {
20590 time_boot_ms: 0_u32,
20591 value: 0.0_f32,
20592 name: CharArray::new([0_u8; 10usize]),
20593 };
20594 #[cfg(feature = "arbitrary")]
20595 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
20596 use arbitrary::{Arbitrary, Unstructured};
20597 let mut buf = [0u8; 1024];
20598 rng.fill_bytes(&mut buf);
20599 let mut unstructured = Unstructured::new(&buf);
20600 Self::arbitrary(&mut unstructured).unwrap_or_default()
20601 }
20602}
20603impl Default for NAMED_VALUE_FLOAT_DATA {
20604 fn default() -> Self {
20605 Self::DEFAULT.clone()
20606 }
20607}
20608impl MessageData for NAMED_VALUE_FLOAT_DATA {
20609 type Message = MavMessage;
20610 const ID: u32 = 251u32;
20611 const NAME: &'static str = "NAMED_VALUE_FLOAT";
20612 const EXTRA_CRC: u8 = 170u8;
20613 const ENCODED_LEN: usize = 18usize;
20614 fn deser(
20615 _version: MavlinkVersion,
20616 __input: &[u8],
20617 ) -> Result<Self, ::mavlink_core::error::ParserError> {
20618 let avail_len = __input.len();
20619 let mut payload_buf = [0; Self::ENCODED_LEN];
20620 let mut buf = if avail_len < Self::ENCODED_LEN {
20621 payload_buf[0..avail_len].copy_from_slice(__input);
20622 Bytes::new(&payload_buf)
20623 } else {
20624 Bytes::new(__input)
20625 };
20626 let mut __struct = Self::default();
20627 __struct.time_boot_ms = buf.get_u32_le();
20628 __struct.value = buf.get_f32_le();
20629 let mut tmp = [0_u8; 10usize];
20630 for v in &mut tmp {
20631 *v = buf.get_u8();
20632 }
20633 __struct.name = CharArray::new(tmp);
20634 Ok(__struct)
20635 }
20636 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
20637 let mut __tmp = BytesMut::new(bytes);
20638 #[allow(clippy::absurd_extreme_comparisons)]
20639 #[allow(unused_comparisons)]
20640 if __tmp.remaining() < Self::ENCODED_LEN {
20641 panic!(
20642 "buffer is too small (need {} bytes, but got {})",
20643 Self::ENCODED_LEN,
20644 __tmp.remaining(),
20645 )
20646 }
20647 __tmp.put_u32_le(self.time_boot_ms);
20648 __tmp.put_f32_le(self.value);
20649 for val in &self.name {
20650 __tmp.put_u8(*val);
20651 }
20652 if matches!(version, MavlinkVersion::V2) {
20653 let len = __tmp.len();
20654 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
20655 } else {
20656 __tmp.len()
20657 }
20658 }
20659}
20660#[doc = "Send a key-value pair as integer. The use of this message is discouraged for normal packets, but a quite efficient way for testing new messages and getting experimental debug output."]
20661#[doc = ""]
20662#[doc = "ID: 252"]
20663#[derive(Debug, Clone, PartialEq)]
20664#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
20665#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
20666#[cfg_attr(feature = "ts", derive(TS))]
20667#[cfg_attr(feature = "ts", ts(export))]
20668pub struct NAMED_VALUE_INT_DATA {
20669 #[doc = "Timestamp (time since system boot)."]
20670 pub time_boot_ms: u32,
20671 #[doc = "Signed integer value"]
20672 pub value: i32,
20673 #[doc = "Name of the debug variable"]
20674 #[cfg_attr(feature = "ts", ts(type = "string"))]
20675 pub name: CharArray<10>,
20676}
20677impl NAMED_VALUE_INT_DATA {
20678 pub const ENCODED_LEN: usize = 18usize;
20679 pub const DEFAULT: Self = Self {
20680 time_boot_ms: 0_u32,
20681 value: 0_i32,
20682 name: CharArray::new([0_u8; 10usize]),
20683 };
20684 #[cfg(feature = "arbitrary")]
20685 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
20686 use arbitrary::{Arbitrary, Unstructured};
20687 let mut buf = [0u8; 1024];
20688 rng.fill_bytes(&mut buf);
20689 let mut unstructured = Unstructured::new(&buf);
20690 Self::arbitrary(&mut unstructured).unwrap_or_default()
20691 }
20692}
20693impl Default for NAMED_VALUE_INT_DATA {
20694 fn default() -> Self {
20695 Self::DEFAULT.clone()
20696 }
20697}
20698impl MessageData for NAMED_VALUE_INT_DATA {
20699 type Message = MavMessage;
20700 const ID: u32 = 252u32;
20701 const NAME: &'static str = "NAMED_VALUE_INT";
20702 const EXTRA_CRC: u8 = 44u8;
20703 const ENCODED_LEN: usize = 18usize;
20704 fn deser(
20705 _version: MavlinkVersion,
20706 __input: &[u8],
20707 ) -> Result<Self, ::mavlink_core::error::ParserError> {
20708 let avail_len = __input.len();
20709 let mut payload_buf = [0; Self::ENCODED_LEN];
20710 let mut buf = if avail_len < Self::ENCODED_LEN {
20711 payload_buf[0..avail_len].copy_from_slice(__input);
20712 Bytes::new(&payload_buf)
20713 } else {
20714 Bytes::new(__input)
20715 };
20716 let mut __struct = Self::default();
20717 __struct.time_boot_ms = buf.get_u32_le();
20718 __struct.value = buf.get_i32_le();
20719 let mut tmp = [0_u8; 10usize];
20720 for v in &mut tmp {
20721 *v = buf.get_u8();
20722 }
20723 __struct.name = CharArray::new(tmp);
20724 Ok(__struct)
20725 }
20726 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
20727 let mut __tmp = BytesMut::new(bytes);
20728 #[allow(clippy::absurd_extreme_comparisons)]
20729 #[allow(unused_comparisons)]
20730 if __tmp.remaining() < Self::ENCODED_LEN {
20731 panic!(
20732 "buffer is too small (need {} bytes, but got {})",
20733 Self::ENCODED_LEN,
20734 __tmp.remaining(),
20735 )
20736 }
20737 __tmp.put_u32_le(self.time_boot_ms);
20738 __tmp.put_i32_le(self.value);
20739 for val in &self.name {
20740 __tmp.put_u8(*val);
20741 }
20742 if matches!(version, MavlinkVersion::V2) {
20743 let len = __tmp.len();
20744 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
20745 } else {
20746 __tmp.len()
20747 }
20748 }
20749}
20750#[doc = "The state of the navigation and position controller."]
20751#[doc = ""]
20752#[doc = "ID: 62"]
20753#[derive(Debug, Clone, PartialEq)]
20754#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
20755#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
20756#[cfg_attr(feature = "ts", derive(TS))]
20757#[cfg_attr(feature = "ts", ts(export))]
20758pub struct NAV_CONTROLLER_OUTPUT_DATA {
20759 #[doc = "Current desired roll"]
20760 pub nav_roll: f32,
20761 #[doc = "Current desired pitch"]
20762 pub nav_pitch: f32,
20763 #[doc = "Current altitude error"]
20764 pub alt_error: f32,
20765 #[doc = "Current airspeed error"]
20766 pub aspd_error: f32,
20767 #[doc = "Current crosstrack error on x-y plane"]
20768 pub xtrack_error: f32,
20769 #[doc = "Current desired heading"]
20770 pub nav_bearing: i16,
20771 #[doc = "Bearing to current waypoint/target"]
20772 pub target_bearing: i16,
20773 #[doc = "Distance to active waypoint"]
20774 pub wp_dist: u16,
20775}
20776impl NAV_CONTROLLER_OUTPUT_DATA {
20777 pub const ENCODED_LEN: usize = 26usize;
20778 pub const DEFAULT: Self = Self {
20779 nav_roll: 0.0_f32,
20780 nav_pitch: 0.0_f32,
20781 alt_error: 0.0_f32,
20782 aspd_error: 0.0_f32,
20783 xtrack_error: 0.0_f32,
20784 nav_bearing: 0_i16,
20785 target_bearing: 0_i16,
20786 wp_dist: 0_u16,
20787 };
20788 #[cfg(feature = "arbitrary")]
20789 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
20790 use arbitrary::{Arbitrary, Unstructured};
20791 let mut buf = [0u8; 1024];
20792 rng.fill_bytes(&mut buf);
20793 let mut unstructured = Unstructured::new(&buf);
20794 Self::arbitrary(&mut unstructured).unwrap_or_default()
20795 }
20796}
20797impl Default for NAV_CONTROLLER_OUTPUT_DATA {
20798 fn default() -> Self {
20799 Self::DEFAULT.clone()
20800 }
20801}
20802impl MessageData for NAV_CONTROLLER_OUTPUT_DATA {
20803 type Message = MavMessage;
20804 const ID: u32 = 62u32;
20805 const NAME: &'static str = "NAV_CONTROLLER_OUTPUT";
20806 const EXTRA_CRC: u8 = 183u8;
20807 const ENCODED_LEN: usize = 26usize;
20808 fn deser(
20809 _version: MavlinkVersion,
20810 __input: &[u8],
20811 ) -> Result<Self, ::mavlink_core::error::ParserError> {
20812 let avail_len = __input.len();
20813 let mut payload_buf = [0; Self::ENCODED_LEN];
20814 let mut buf = if avail_len < Self::ENCODED_LEN {
20815 payload_buf[0..avail_len].copy_from_slice(__input);
20816 Bytes::new(&payload_buf)
20817 } else {
20818 Bytes::new(__input)
20819 };
20820 let mut __struct = Self::default();
20821 __struct.nav_roll = buf.get_f32_le();
20822 __struct.nav_pitch = buf.get_f32_le();
20823 __struct.alt_error = buf.get_f32_le();
20824 __struct.aspd_error = buf.get_f32_le();
20825 __struct.xtrack_error = buf.get_f32_le();
20826 __struct.nav_bearing = buf.get_i16_le();
20827 __struct.target_bearing = buf.get_i16_le();
20828 __struct.wp_dist = buf.get_u16_le();
20829 Ok(__struct)
20830 }
20831 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
20832 let mut __tmp = BytesMut::new(bytes);
20833 #[allow(clippy::absurd_extreme_comparisons)]
20834 #[allow(unused_comparisons)]
20835 if __tmp.remaining() < Self::ENCODED_LEN {
20836 panic!(
20837 "buffer is too small (need {} bytes, but got {})",
20838 Self::ENCODED_LEN,
20839 __tmp.remaining(),
20840 )
20841 }
20842 __tmp.put_f32_le(self.nav_roll);
20843 __tmp.put_f32_le(self.nav_pitch);
20844 __tmp.put_f32_le(self.alt_error);
20845 __tmp.put_f32_le(self.aspd_error);
20846 __tmp.put_f32_le(self.xtrack_error);
20847 __tmp.put_i16_le(self.nav_bearing);
20848 __tmp.put_i16_le(self.target_bearing);
20849 __tmp.put_u16_le(self.wp_dist);
20850 if matches!(version, MavlinkVersion::V2) {
20851 let len = __tmp.len();
20852 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
20853 } else {
20854 __tmp.len()
20855 }
20856 }
20857}
20858#[doc = "Obstacle distances in front of the sensor, starting from the left in increment degrees to the right."]
20859#[doc = ""]
20860#[doc = "ID: 330"]
20861#[derive(Debug, Clone, PartialEq)]
20862#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
20863#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
20864#[cfg_attr(feature = "ts", derive(TS))]
20865#[cfg_attr(feature = "ts", ts(export))]
20866pub struct OBSTACLE_DISTANCE_DATA {
20867 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
20868 pub time_usec: u64,
20869 #[doc = "Distance of obstacles around the vehicle with index 0 corresponding to north + angle_offset, unless otherwise specified in the frame. A value of 0 is valid and means that the obstacle is practically touching the sensor. A value of max_distance +1 means no obstacle is present. A value of UINT16_MAX for unknown/not used. In a array element, one unit corresponds to 1cm."]
20870 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
20871 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
20872 pub distances: [u16; 72],
20873 #[doc = "Minimum distance the sensor can measure."]
20874 pub min_distance: u16,
20875 #[doc = "Maximum distance the sensor can measure."]
20876 pub max_distance: u16,
20877 #[doc = "Class id of the distance sensor type."]
20878 pub sensor_type: MavDistanceSensor,
20879 #[doc = "Angular width in degrees of each array element. Increment direction is clockwise. This field is ignored if increment_f is non-zero."]
20880 pub increment: u8,
20881 #[doc = "Angular width in degrees of each array element as a float. If non-zero then this value is used instead of the uint8_t increment field. Positive is clockwise direction, negative is counter-clockwise."]
20882 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
20883 pub increment_f: f32,
20884 #[doc = "Relative angle offset of the 0-index element in the distances array. Value of 0 corresponds to forward. Positive is clockwise direction, negative is counter-clockwise."]
20885 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
20886 pub angle_offset: f32,
20887 #[doc = "Coordinate frame of reference for the yaw rotation and offset of the sensor data. Defaults to MAV_FRAME_GLOBAL, which is north aligned. For body-mounted sensors use MAV_FRAME_BODY_FRD, which is vehicle front aligned."]
20888 #[cfg_attr(feature = "serde", serde(default))]
20889 pub frame: MavFrame,
20890}
20891impl OBSTACLE_DISTANCE_DATA {
20892 pub const ENCODED_LEN: usize = 167usize;
20893 pub const DEFAULT: Self = Self {
20894 time_usec: 0_u64,
20895 distances: [0_u16; 72usize],
20896 min_distance: 0_u16,
20897 max_distance: 0_u16,
20898 sensor_type: MavDistanceSensor::DEFAULT,
20899 increment: 0_u8,
20900 increment_f: 0.0_f32,
20901 angle_offset: 0.0_f32,
20902 frame: MavFrame::DEFAULT,
20903 };
20904 #[cfg(feature = "arbitrary")]
20905 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
20906 use arbitrary::{Arbitrary, Unstructured};
20907 let mut buf = [0u8; 1024];
20908 rng.fill_bytes(&mut buf);
20909 let mut unstructured = Unstructured::new(&buf);
20910 Self::arbitrary(&mut unstructured).unwrap_or_default()
20911 }
20912}
20913impl Default for OBSTACLE_DISTANCE_DATA {
20914 fn default() -> Self {
20915 Self::DEFAULT.clone()
20916 }
20917}
20918impl MessageData for OBSTACLE_DISTANCE_DATA {
20919 type Message = MavMessage;
20920 const ID: u32 = 330u32;
20921 const NAME: &'static str = "OBSTACLE_DISTANCE";
20922 const EXTRA_CRC: u8 = 23u8;
20923 const ENCODED_LEN: usize = 167usize;
20924 fn deser(
20925 _version: MavlinkVersion,
20926 __input: &[u8],
20927 ) -> Result<Self, ::mavlink_core::error::ParserError> {
20928 let avail_len = __input.len();
20929 let mut payload_buf = [0; Self::ENCODED_LEN];
20930 let mut buf = if avail_len < Self::ENCODED_LEN {
20931 payload_buf[0..avail_len].copy_from_slice(__input);
20932 Bytes::new(&payload_buf)
20933 } else {
20934 Bytes::new(__input)
20935 };
20936 let mut __struct = Self::default();
20937 __struct.time_usec = buf.get_u64_le();
20938 for v in &mut __struct.distances {
20939 let val = buf.get_u16_le();
20940 *v = val;
20941 }
20942 __struct.min_distance = buf.get_u16_le();
20943 __struct.max_distance = buf.get_u16_le();
20944 let tmp = buf.get_u8();
20945 __struct.sensor_type =
20946 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
20947 enum_type: "MavDistanceSensor",
20948 value: tmp as u64,
20949 })?;
20950 __struct.increment = buf.get_u8();
20951 __struct.increment_f = buf.get_f32_le();
20952 __struct.angle_offset = buf.get_f32_le();
20953 let tmp = buf.get_u8();
20954 __struct.frame =
20955 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
20956 enum_type: "MavFrame",
20957 value: tmp as u64,
20958 })?;
20959 Ok(__struct)
20960 }
20961 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
20962 let mut __tmp = BytesMut::new(bytes);
20963 #[allow(clippy::absurd_extreme_comparisons)]
20964 #[allow(unused_comparisons)]
20965 if __tmp.remaining() < Self::ENCODED_LEN {
20966 panic!(
20967 "buffer is too small (need {} bytes, but got {})",
20968 Self::ENCODED_LEN,
20969 __tmp.remaining(),
20970 )
20971 }
20972 __tmp.put_u64_le(self.time_usec);
20973 for val in &self.distances {
20974 __tmp.put_u16_le(*val);
20975 }
20976 __tmp.put_u16_le(self.min_distance);
20977 __tmp.put_u16_le(self.max_distance);
20978 __tmp.put_u8(self.sensor_type as u8);
20979 __tmp.put_u8(self.increment);
20980 if matches!(version, MavlinkVersion::V2) {
20981 __tmp.put_f32_le(self.increment_f);
20982 __tmp.put_f32_le(self.angle_offset);
20983 __tmp.put_u8(self.frame as u8);
20984 let len = __tmp.len();
20985 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
20986 } else {
20987 __tmp.len()
20988 }
20989 }
20990}
20991#[doc = "Odometry message to communicate odometry information with an external interface. Fits ROS REP 147 standard for aerial vehicles (<http://www.ros.org/reps/rep-0147.html>)."]
20992#[doc = ""]
20993#[doc = "ID: 331"]
20994#[derive(Debug, Clone, PartialEq)]
20995#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
20996#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
20997#[cfg_attr(feature = "ts", derive(TS))]
20998#[cfg_attr(feature = "ts", ts(export))]
20999pub struct ODOMETRY_DATA {
21000 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
21001 pub time_usec: u64,
21002 #[doc = "X Position"]
21003 pub x: f32,
21004 #[doc = "Y Position"]
21005 pub y: f32,
21006 #[doc = "Z Position"]
21007 pub z: f32,
21008 #[doc = "Quaternion components, w, x, y, z (1 0 0 0 is the null-rotation)"]
21009 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
21010 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
21011 pub q: [f32; 4],
21012 #[doc = "X linear speed"]
21013 pub vx: f32,
21014 #[doc = "Y linear speed"]
21015 pub vy: f32,
21016 #[doc = "Z linear speed"]
21017 pub vz: f32,
21018 #[doc = "Roll angular speed"]
21019 pub rollspeed: f32,
21020 #[doc = "Pitch angular speed"]
21021 pub pitchspeed: f32,
21022 #[doc = "Yaw angular speed"]
21023 pub yawspeed: f32,
21024 #[doc = "Row-major representation of a 6x6 pose cross-covariance matrix upper right triangle (states: x, y, z, roll, pitch, yaw; first six entries are the first ROW, next five entries are the second ROW, etc.). If unknown, assign NaN value to first element in the array."]
21025 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
21026 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
21027 pub pose_covariance: [f32; 21],
21028 #[doc = "Row-major representation of a 6x6 velocity cross-covariance matrix upper right triangle (states: vx, vy, vz, rollspeed, pitchspeed, yawspeed; first six entries are the first ROW, next five entries are the second ROW, etc.). If unknown, assign NaN value to first element in the array."]
21029 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
21030 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
21031 pub velocity_covariance: [f32; 21],
21032 #[doc = "Coordinate frame of reference for the pose data."]
21033 pub frame_id: MavFrame,
21034 #[doc = "Coordinate frame of reference for the velocity in free space (twist) data."]
21035 pub child_frame_id: MavFrame,
21036 #[doc = "Estimate reset counter. This should be incremented when the estimate resets in any of the dimensions (position, velocity, attitude, angular speed). This is designed to be used when e.g an external SLAM system detects a loop-closure and the estimate jumps."]
21037 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
21038 pub reset_counter: u8,
21039 #[doc = "Type of estimator that is providing the odometry."]
21040 #[cfg_attr(feature = "serde", serde(default))]
21041 pub estimator_type: MavEstimatorType,
21042 #[doc = "Optional odometry quality metric as a percentage. -1 = odometry has failed, 0 = unknown/unset quality, 1 = worst quality, 100 = best quality"]
21043 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
21044 pub quality: i8,
21045}
21046impl ODOMETRY_DATA {
21047 pub const ENCODED_LEN: usize = 233usize;
21048 pub const DEFAULT: Self = Self {
21049 time_usec: 0_u64,
21050 x: 0.0_f32,
21051 y: 0.0_f32,
21052 z: 0.0_f32,
21053 q: [0.0_f32; 4usize],
21054 vx: 0.0_f32,
21055 vy: 0.0_f32,
21056 vz: 0.0_f32,
21057 rollspeed: 0.0_f32,
21058 pitchspeed: 0.0_f32,
21059 yawspeed: 0.0_f32,
21060 pose_covariance: [0.0_f32; 21usize],
21061 velocity_covariance: [0.0_f32; 21usize],
21062 frame_id: MavFrame::DEFAULT,
21063 child_frame_id: MavFrame::DEFAULT,
21064 reset_counter: 0_u8,
21065 estimator_type: MavEstimatorType::DEFAULT,
21066 quality: 0_i8,
21067 };
21068 #[cfg(feature = "arbitrary")]
21069 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
21070 use arbitrary::{Arbitrary, Unstructured};
21071 let mut buf = [0u8; 1024];
21072 rng.fill_bytes(&mut buf);
21073 let mut unstructured = Unstructured::new(&buf);
21074 Self::arbitrary(&mut unstructured).unwrap_or_default()
21075 }
21076}
21077impl Default for ODOMETRY_DATA {
21078 fn default() -> Self {
21079 Self::DEFAULT.clone()
21080 }
21081}
21082impl MessageData for ODOMETRY_DATA {
21083 type Message = MavMessage;
21084 const ID: u32 = 331u32;
21085 const NAME: &'static str = "ODOMETRY";
21086 const EXTRA_CRC: u8 = 91u8;
21087 const ENCODED_LEN: usize = 233usize;
21088 fn deser(
21089 _version: MavlinkVersion,
21090 __input: &[u8],
21091 ) -> Result<Self, ::mavlink_core::error::ParserError> {
21092 let avail_len = __input.len();
21093 let mut payload_buf = [0; Self::ENCODED_LEN];
21094 let mut buf = if avail_len < Self::ENCODED_LEN {
21095 payload_buf[0..avail_len].copy_from_slice(__input);
21096 Bytes::new(&payload_buf)
21097 } else {
21098 Bytes::new(__input)
21099 };
21100 let mut __struct = Self::default();
21101 __struct.time_usec = buf.get_u64_le();
21102 __struct.x = buf.get_f32_le();
21103 __struct.y = buf.get_f32_le();
21104 __struct.z = buf.get_f32_le();
21105 for v in &mut __struct.q {
21106 let val = buf.get_f32_le();
21107 *v = val;
21108 }
21109 __struct.vx = buf.get_f32_le();
21110 __struct.vy = buf.get_f32_le();
21111 __struct.vz = buf.get_f32_le();
21112 __struct.rollspeed = buf.get_f32_le();
21113 __struct.pitchspeed = buf.get_f32_le();
21114 __struct.yawspeed = buf.get_f32_le();
21115 for v in &mut __struct.pose_covariance {
21116 let val = buf.get_f32_le();
21117 *v = val;
21118 }
21119 for v in &mut __struct.velocity_covariance {
21120 let val = buf.get_f32_le();
21121 *v = val;
21122 }
21123 let tmp = buf.get_u8();
21124 __struct.frame_id =
21125 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
21126 enum_type: "MavFrame",
21127 value: tmp as u64,
21128 })?;
21129 let tmp = buf.get_u8();
21130 __struct.child_frame_id =
21131 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
21132 enum_type: "MavFrame",
21133 value: tmp as u64,
21134 })?;
21135 __struct.reset_counter = buf.get_u8();
21136 let tmp = buf.get_u8();
21137 __struct.estimator_type =
21138 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
21139 enum_type: "MavEstimatorType",
21140 value: tmp as u64,
21141 })?;
21142 __struct.quality = buf.get_i8();
21143 Ok(__struct)
21144 }
21145 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
21146 let mut __tmp = BytesMut::new(bytes);
21147 #[allow(clippy::absurd_extreme_comparisons)]
21148 #[allow(unused_comparisons)]
21149 if __tmp.remaining() < Self::ENCODED_LEN {
21150 panic!(
21151 "buffer is too small (need {} bytes, but got {})",
21152 Self::ENCODED_LEN,
21153 __tmp.remaining(),
21154 )
21155 }
21156 __tmp.put_u64_le(self.time_usec);
21157 __tmp.put_f32_le(self.x);
21158 __tmp.put_f32_le(self.y);
21159 __tmp.put_f32_le(self.z);
21160 for val in &self.q {
21161 __tmp.put_f32_le(*val);
21162 }
21163 __tmp.put_f32_le(self.vx);
21164 __tmp.put_f32_le(self.vy);
21165 __tmp.put_f32_le(self.vz);
21166 __tmp.put_f32_le(self.rollspeed);
21167 __tmp.put_f32_le(self.pitchspeed);
21168 __tmp.put_f32_le(self.yawspeed);
21169 for val in &self.pose_covariance {
21170 __tmp.put_f32_le(*val);
21171 }
21172 for val in &self.velocity_covariance {
21173 __tmp.put_f32_le(*val);
21174 }
21175 __tmp.put_u8(self.frame_id as u8);
21176 __tmp.put_u8(self.child_frame_id as u8);
21177 if matches!(version, MavlinkVersion::V2) {
21178 __tmp.put_u8(self.reset_counter);
21179 __tmp.put_u8(self.estimator_type as u8);
21180 __tmp.put_i8(self.quality);
21181 let len = __tmp.len();
21182 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
21183 } else {
21184 __tmp.len()
21185 }
21186 }
21187}
21188#[doc = "Hardware status sent by an onboard computer."]
21189#[doc = ""]
21190#[doc = "ID: 390"]
21191#[derive(Debug, Clone, PartialEq)]
21192#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
21193#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
21194#[cfg_attr(feature = "ts", derive(TS))]
21195#[cfg_attr(feature = "ts", ts(export))]
21196pub struct ONBOARD_COMPUTER_STATUS_DATA {
21197 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
21198 pub time_usec: u64,
21199 #[doc = "Time since system boot."]
21200 pub uptime: u32,
21201 #[doc = "Amount of used RAM on the component system. A value of UINT32_MAX implies the field is unused."]
21202 pub ram_usage: u32,
21203 #[doc = "Total amount of RAM on the component system. A value of UINT32_MAX implies the field is unused."]
21204 pub ram_total: u32,
21205 #[doc = "Storage type: 0: HDD, 1: SSD, 2: EMMC, 3: SD card (non-removable), 4: SD card (removable). A value of UINT32_MAX implies the field is unused."]
21206 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
21207 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
21208 pub storage_type: [u32; 4],
21209 #[doc = "Amount of used storage space on the component system. A value of UINT32_MAX implies the field is unused."]
21210 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
21211 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
21212 pub storage_usage: [u32; 4],
21213 #[doc = "Total amount of storage space on the component system. A value of UINT32_MAX implies the field is unused."]
21214 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
21215 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
21216 pub storage_total: [u32; 4],
21217 #[doc = "Link type: 0-9: UART, 10-19: Wired network, 20-29: Wifi, 30-39: Point-to-point proprietary, 40-49: Mesh proprietary"]
21218 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
21219 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
21220 pub link_type: [u32; 6],
21221 #[doc = "Network traffic from the component system. A value of UINT32_MAX implies the field is unused."]
21222 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
21223 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
21224 pub link_tx_rate: [u32; 6],
21225 #[doc = "Network traffic to the component system. A value of UINT32_MAX implies the field is unused."]
21226 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
21227 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
21228 pub link_rx_rate: [u32; 6],
21229 #[doc = "Network capacity from the component system. A value of UINT32_MAX implies the field is unused."]
21230 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
21231 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
21232 pub link_tx_max: [u32; 6],
21233 #[doc = "Network capacity to the component system. A value of UINT32_MAX implies the field is unused."]
21234 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
21235 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
21236 pub link_rx_max: [u32; 6],
21237 #[doc = "Fan speeds. A value of INT16_MAX implies the field is unused."]
21238 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
21239 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
21240 pub fan_speed: [i16; 4],
21241 #[doc = "Type of the onboard computer: 0: Mission computer primary, 1: Mission computer backup 1, 2: Mission computer backup 2, 3: Compute node, 4-5: Compute spares, 6-9: Payload computers."]
21242 pub mavtype: u8,
21243 #[doc = "CPU usage on the component in percent (100 - idle). A value of UINT8_MAX implies the field is unused."]
21244 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
21245 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
21246 pub cpu_cores: [u8; 8],
21247 #[doc = "Combined CPU usage as the last 10 slices of 100 MS (a histogram). This allows to identify spikes in load that max out the system, but only for a short amount of time. A value of UINT8_MAX implies the field is unused."]
21248 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
21249 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
21250 pub cpu_combined: [u8; 10],
21251 #[doc = "GPU usage on the component in percent (100 - idle). A value of UINT8_MAX implies the field is unused."]
21252 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
21253 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
21254 pub gpu_cores: [u8; 4],
21255 #[doc = "Combined GPU usage as the last 10 slices of 100 MS (a histogram). This allows to identify spikes in load that max out the system, but only for a short amount of time. A value of UINT8_MAX implies the field is unused."]
21256 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
21257 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
21258 pub gpu_combined: [u8; 10],
21259 #[doc = "Temperature of the board. A value of INT8_MAX implies the field is unused."]
21260 pub temperature_board: i8,
21261 #[doc = "Temperature of the CPU core. A value of INT8_MAX implies the field is unused."]
21262 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
21263 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
21264 pub temperature_core: [i8; 8],
21265}
21266impl ONBOARD_COMPUTER_STATUS_DATA {
21267 pub const ENCODED_LEN: usize = 238usize;
21268 pub const DEFAULT: Self = Self {
21269 time_usec: 0_u64,
21270 uptime: 0_u32,
21271 ram_usage: 0_u32,
21272 ram_total: 0_u32,
21273 storage_type: [0_u32; 4usize],
21274 storage_usage: [0_u32; 4usize],
21275 storage_total: [0_u32; 4usize],
21276 link_type: [0_u32; 6usize],
21277 link_tx_rate: [0_u32; 6usize],
21278 link_rx_rate: [0_u32; 6usize],
21279 link_tx_max: [0_u32; 6usize],
21280 link_rx_max: [0_u32; 6usize],
21281 fan_speed: [0_i16; 4usize],
21282 mavtype: 0_u8,
21283 cpu_cores: [0_u8; 8usize],
21284 cpu_combined: [0_u8; 10usize],
21285 gpu_cores: [0_u8; 4usize],
21286 gpu_combined: [0_u8; 10usize],
21287 temperature_board: 0_i8,
21288 temperature_core: [0_i8; 8usize],
21289 };
21290 #[cfg(feature = "arbitrary")]
21291 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
21292 use arbitrary::{Arbitrary, Unstructured};
21293 let mut buf = [0u8; 1024];
21294 rng.fill_bytes(&mut buf);
21295 let mut unstructured = Unstructured::new(&buf);
21296 Self::arbitrary(&mut unstructured).unwrap_or_default()
21297 }
21298}
21299impl Default for ONBOARD_COMPUTER_STATUS_DATA {
21300 fn default() -> Self {
21301 Self::DEFAULT.clone()
21302 }
21303}
21304impl MessageData for ONBOARD_COMPUTER_STATUS_DATA {
21305 type Message = MavMessage;
21306 const ID: u32 = 390u32;
21307 const NAME: &'static str = "ONBOARD_COMPUTER_STATUS";
21308 const EXTRA_CRC: u8 = 156u8;
21309 const ENCODED_LEN: usize = 238usize;
21310 fn deser(
21311 _version: MavlinkVersion,
21312 __input: &[u8],
21313 ) -> Result<Self, ::mavlink_core::error::ParserError> {
21314 let avail_len = __input.len();
21315 let mut payload_buf = [0; Self::ENCODED_LEN];
21316 let mut buf = if avail_len < Self::ENCODED_LEN {
21317 payload_buf[0..avail_len].copy_from_slice(__input);
21318 Bytes::new(&payload_buf)
21319 } else {
21320 Bytes::new(__input)
21321 };
21322 let mut __struct = Self::default();
21323 __struct.time_usec = buf.get_u64_le();
21324 __struct.uptime = buf.get_u32_le();
21325 __struct.ram_usage = buf.get_u32_le();
21326 __struct.ram_total = buf.get_u32_le();
21327 for v in &mut __struct.storage_type {
21328 let val = buf.get_u32_le();
21329 *v = val;
21330 }
21331 for v in &mut __struct.storage_usage {
21332 let val = buf.get_u32_le();
21333 *v = val;
21334 }
21335 for v in &mut __struct.storage_total {
21336 let val = buf.get_u32_le();
21337 *v = val;
21338 }
21339 for v in &mut __struct.link_type {
21340 let val = buf.get_u32_le();
21341 *v = val;
21342 }
21343 for v in &mut __struct.link_tx_rate {
21344 let val = buf.get_u32_le();
21345 *v = val;
21346 }
21347 for v in &mut __struct.link_rx_rate {
21348 let val = buf.get_u32_le();
21349 *v = val;
21350 }
21351 for v in &mut __struct.link_tx_max {
21352 let val = buf.get_u32_le();
21353 *v = val;
21354 }
21355 for v in &mut __struct.link_rx_max {
21356 let val = buf.get_u32_le();
21357 *v = val;
21358 }
21359 for v in &mut __struct.fan_speed {
21360 let val = buf.get_i16_le();
21361 *v = val;
21362 }
21363 __struct.mavtype = buf.get_u8();
21364 for v in &mut __struct.cpu_cores {
21365 let val = buf.get_u8();
21366 *v = val;
21367 }
21368 for v in &mut __struct.cpu_combined {
21369 let val = buf.get_u8();
21370 *v = val;
21371 }
21372 for v in &mut __struct.gpu_cores {
21373 let val = buf.get_u8();
21374 *v = val;
21375 }
21376 for v in &mut __struct.gpu_combined {
21377 let val = buf.get_u8();
21378 *v = val;
21379 }
21380 __struct.temperature_board = buf.get_i8();
21381 for v in &mut __struct.temperature_core {
21382 let val = buf.get_i8();
21383 *v = val;
21384 }
21385 Ok(__struct)
21386 }
21387 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
21388 let mut __tmp = BytesMut::new(bytes);
21389 #[allow(clippy::absurd_extreme_comparisons)]
21390 #[allow(unused_comparisons)]
21391 if __tmp.remaining() < Self::ENCODED_LEN {
21392 panic!(
21393 "buffer is too small (need {} bytes, but got {})",
21394 Self::ENCODED_LEN,
21395 __tmp.remaining(),
21396 )
21397 }
21398 __tmp.put_u64_le(self.time_usec);
21399 __tmp.put_u32_le(self.uptime);
21400 __tmp.put_u32_le(self.ram_usage);
21401 __tmp.put_u32_le(self.ram_total);
21402 for val in &self.storage_type {
21403 __tmp.put_u32_le(*val);
21404 }
21405 for val in &self.storage_usage {
21406 __tmp.put_u32_le(*val);
21407 }
21408 for val in &self.storage_total {
21409 __tmp.put_u32_le(*val);
21410 }
21411 for val in &self.link_type {
21412 __tmp.put_u32_le(*val);
21413 }
21414 for val in &self.link_tx_rate {
21415 __tmp.put_u32_le(*val);
21416 }
21417 for val in &self.link_rx_rate {
21418 __tmp.put_u32_le(*val);
21419 }
21420 for val in &self.link_tx_max {
21421 __tmp.put_u32_le(*val);
21422 }
21423 for val in &self.link_rx_max {
21424 __tmp.put_u32_le(*val);
21425 }
21426 for val in &self.fan_speed {
21427 __tmp.put_i16_le(*val);
21428 }
21429 __tmp.put_u8(self.mavtype);
21430 for val in &self.cpu_cores {
21431 __tmp.put_u8(*val);
21432 }
21433 for val in &self.cpu_combined {
21434 __tmp.put_u8(*val);
21435 }
21436 for val in &self.gpu_cores {
21437 __tmp.put_u8(*val);
21438 }
21439 for val in &self.gpu_combined {
21440 __tmp.put_u8(*val);
21441 }
21442 __tmp.put_i8(self.temperature_board);
21443 for val in &self.temperature_core {
21444 __tmp.put_i8(*val);
21445 }
21446 if matches!(version, MavlinkVersion::V2) {
21447 let len = __tmp.len();
21448 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
21449 } else {
21450 __tmp.len()
21451 }
21452 }
21453}
21454#[doc = "Transmitter (remote ID system) is enabled and ready to start sending location and other required information. This is streamed by transmitter. A flight controller uses it as a condition to arm."]
21455#[doc = ""]
21456#[doc = "ID: 12918"]
21457#[derive(Debug, Clone, PartialEq)]
21458#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
21459#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
21460#[cfg_attr(feature = "ts", derive(TS))]
21461#[cfg_attr(feature = "ts", ts(export))]
21462pub struct OPEN_DRONE_ID_ARM_STATUS_DATA {
21463 #[doc = "Status level indicating if arming is allowed."]
21464 pub status: MavOdidArmStatus,
21465 #[doc = "Text error message, should be empty if status is good to arm. Fill with nulls in unused portion."]
21466 #[cfg_attr(feature = "ts", ts(type = "string"))]
21467 pub error: CharArray<50>,
21468}
21469impl OPEN_DRONE_ID_ARM_STATUS_DATA {
21470 pub const ENCODED_LEN: usize = 51usize;
21471 pub const DEFAULT: Self = Self {
21472 status: MavOdidArmStatus::DEFAULT,
21473 error: CharArray::new([0_u8; 50usize]),
21474 };
21475 #[cfg(feature = "arbitrary")]
21476 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
21477 use arbitrary::{Arbitrary, Unstructured};
21478 let mut buf = [0u8; 1024];
21479 rng.fill_bytes(&mut buf);
21480 let mut unstructured = Unstructured::new(&buf);
21481 Self::arbitrary(&mut unstructured).unwrap_or_default()
21482 }
21483}
21484impl Default for OPEN_DRONE_ID_ARM_STATUS_DATA {
21485 fn default() -> Self {
21486 Self::DEFAULT.clone()
21487 }
21488}
21489impl MessageData for OPEN_DRONE_ID_ARM_STATUS_DATA {
21490 type Message = MavMessage;
21491 const ID: u32 = 12918u32;
21492 const NAME: &'static str = "OPEN_DRONE_ID_ARM_STATUS";
21493 const EXTRA_CRC: u8 = 139u8;
21494 const ENCODED_LEN: usize = 51usize;
21495 fn deser(
21496 _version: MavlinkVersion,
21497 __input: &[u8],
21498 ) -> Result<Self, ::mavlink_core::error::ParserError> {
21499 let avail_len = __input.len();
21500 let mut payload_buf = [0; Self::ENCODED_LEN];
21501 let mut buf = if avail_len < Self::ENCODED_LEN {
21502 payload_buf[0..avail_len].copy_from_slice(__input);
21503 Bytes::new(&payload_buf)
21504 } else {
21505 Bytes::new(__input)
21506 };
21507 let mut __struct = Self::default();
21508 let tmp = buf.get_u8();
21509 __struct.status =
21510 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
21511 enum_type: "MavOdidArmStatus",
21512 value: tmp as u64,
21513 })?;
21514 let mut tmp = [0_u8; 50usize];
21515 for v in &mut tmp {
21516 *v = buf.get_u8();
21517 }
21518 __struct.error = CharArray::new(tmp);
21519 Ok(__struct)
21520 }
21521 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
21522 let mut __tmp = BytesMut::new(bytes);
21523 #[allow(clippy::absurd_extreme_comparisons)]
21524 #[allow(unused_comparisons)]
21525 if __tmp.remaining() < Self::ENCODED_LEN {
21526 panic!(
21527 "buffer is too small (need {} bytes, but got {})",
21528 Self::ENCODED_LEN,
21529 __tmp.remaining(),
21530 )
21531 }
21532 __tmp.put_u8(self.status as u8);
21533 for val in &self.error {
21534 __tmp.put_u8(*val);
21535 }
21536 if matches!(version, MavlinkVersion::V2) {
21537 let len = __tmp.len();
21538 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
21539 } else {
21540 __tmp.len()
21541 }
21542 }
21543}
21544#[doc = "Data for filling the OpenDroneID Authentication message. The Authentication Message defines a field that can provide a means of authenticity for the identity of the UAS (Unmanned Aircraft System). The Authentication message can have two different formats. For data page 0, the fields PageCount, Length and TimeStamp are present and AuthData is only 17 bytes. For data page 1 through 15, PageCount, Length and TimeStamp are not present and the size of AuthData is 23 bytes."]
21545#[doc = ""]
21546#[doc = "ID: 12902"]
21547#[derive(Debug, Clone, PartialEq)]
21548#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
21549#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
21550#[cfg_attr(feature = "ts", derive(TS))]
21551#[cfg_attr(feature = "ts", ts(export))]
21552pub struct OPEN_DRONE_ID_AUTHENTICATION_DATA {
21553 #[doc = "This field is only present for page 0. 32 bit Unix Timestamp in seconds since 00:00:00 01/01/2019."]
21554 pub timestamp: u32,
21555 #[doc = "System ID (0 for broadcast)."]
21556 pub target_system: u8,
21557 #[doc = "Component ID (0 for broadcast)."]
21558 pub target_component: u8,
21559 #[doc = "Only used for drone ID data received from other UAs. See detailed description at <https://mavlink.io/en/services/opendroneid.html>."]
21560 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
21561 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
21562 pub id_or_mac: [u8; 20],
21563 #[doc = "Indicates the type of authentication."]
21564 pub authentication_type: MavOdidAuthType,
21565 #[doc = "Allowed range is 0 - 15."]
21566 pub data_page: u8,
21567 #[doc = "This field is only present for page 0. Allowed range is 0 - 15. See the description of struct ODID_Auth_data at <https://github.com/opendroneid/opendroneid-core-c/blob/master/libopendroneid/opendroneid.h>."]
21568 pub last_page_index: u8,
21569 #[doc = "This field is only present for page 0. Total bytes of authentication_data from all data pages. See the description of struct ODID_Auth_data at <https://github.com/opendroneid/opendroneid-core-c/blob/master/libopendroneid/opendroneid.h>."]
21570 pub length: u8,
21571 #[doc = "Opaque authentication data. For page 0, the size is only 17 bytes. For other pages, the size is 23 bytes. Shall be filled with nulls in the unused portion of the field."]
21572 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
21573 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
21574 pub authentication_data: [u8; 23],
21575}
21576impl OPEN_DRONE_ID_AUTHENTICATION_DATA {
21577 pub const ENCODED_LEN: usize = 53usize;
21578 pub const DEFAULT: Self = Self {
21579 timestamp: 0_u32,
21580 target_system: 0_u8,
21581 target_component: 0_u8,
21582 id_or_mac: [0_u8; 20usize],
21583 authentication_type: MavOdidAuthType::DEFAULT,
21584 data_page: 0_u8,
21585 last_page_index: 0_u8,
21586 length: 0_u8,
21587 authentication_data: [0_u8; 23usize],
21588 };
21589 #[cfg(feature = "arbitrary")]
21590 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
21591 use arbitrary::{Arbitrary, Unstructured};
21592 let mut buf = [0u8; 1024];
21593 rng.fill_bytes(&mut buf);
21594 let mut unstructured = Unstructured::new(&buf);
21595 Self::arbitrary(&mut unstructured).unwrap_or_default()
21596 }
21597}
21598impl Default for OPEN_DRONE_ID_AUTHENTICATION_DATA {
21599 fn default() -> Self {
21600 Self::DEFAULT.clone()
21601 }
21602}
21603impl MessageData for OPEN_DRONE_ID_AUTHENTICATION_DATA {
21604 type Message = MavMessage;
21605 const ID: u32 = 12902u32;
21606 const NAME: &'static str = "OPEN_DRONE_ID_AUTHENTICATION";
21607 const EXTRA_CRC: u8 = 140u8;
21608 const ENCODED_LEN: usize = 53usize;
21609 fn deser(
21610 _version: MavlinkVersion,
21611 __input: &[u8],
21612 ) -> Result<Self, ::mavlink_core::error::ParserError> {
21613 let avail_len = __input.len();
21614 let mut payload_buf = [0; Self::ENCODED_LEN];
21615 let mut buf = if avail_len < Self::ENCODED_LEN {
21616 payload_buf[0..avail_len].copy_from_slice(__input);
21617 Bytes::new(&payload_buf)
21618 } else {
21619 Bytes::new(__input)
21620 };
21621 let mut __struct = Self::default();
21622 __struct.timestamp = buf.get_u32_le();
21623 __struct.target_system = buf.get_u8();
21624 __struct.target_component = buf.get_u8();
21625 for v in &mut __struct.id_or_mac {
21626 let val = buf.get_u8();
21627 *v = val;
21628 }
21629 let tmp = buf.get_u8();
21630 __struct.authentication_type =
21631 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
21632 enum_type: "MavOdidAuthType",
21633 value: tmp as u64,
21634 })?;
21635 __struct.data_page = buf.get_u8();
21636 __struct.last_page_index = buf.get_u8();
21637 __struct.length = buf.get_u8();
21638 for v in &mut __struct.authentication_data {
21639 let val = buf.get_u8();
21640 *v = val;
21641 }
21642 Ok(__struct)
21643 }
21644 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
21645 let mut __tmp = BytesMut::new(bytes);
21646 #[allow(clippy::absurd_extreme_comparisons)]
21647 #[allow(unused_comparisons)]
21648 if __tmp.remaining() < Self::ENCODED_LEN {
21649 panic!(
21650 "buffer is too small (need {} bytes, but got {})",
21651 Self::ENCODED_LEN,
21652 __tmp.remaining(),
21653 )
21654 }
21655 __tmp.put_u32_le(self.timestamp);
21656 __tmp.put_u8(self.target_system);
21657 __tmp.put_u8(self.target_component);
21658 for val in &self.id_or_mac {
21659 __tmp.put_u8(*val);
21660 }
21661 __tmp.put_u8(self.authentication_type as u8);
21662 __tmp.put_u8(self.data_page);
21663 __tmp.put_u8(self.last_page_index);
21664 __tmp.put_u8(self.length);
21665 for val in &self.authentication_data {
21666 __tmp.put_u8(*val);
21667 }
21668 if matches!(version, MavlinkVersion::V2) {
21669 let len = __tmp.len();
21670 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
21671 } else {
21672 __tmp.len()
21673 }
21674 }
21675}
21676#[doc = "Data for filling the OpenDroneID Basic ID message. This and the below messages are primarily meant for feeding data to/from an OpenDroneID implementation. E.g. <https://github.com/opendroneid/opendroneid-core-c>. These messages are compatible with the ASTM F3411 Remote ID standard and the ASD-STAN prEN 4709-002 Direct Remote ID standard. Additional information and usage of these messages is documented at <https://mavlink.io/en/services/opendroneid.html>."]
21677#[doc = ""]
21678#[doc = "ID: 12900"]
21679#[derive(Debug, Clone, PartialEq)]
21680#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
21681#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
21682#[cfg_attr(feature = "ts", derive(TS))]
21683#[cfg_attr(feature = "ts", ts(export))]
21684pub struct OPEN_DRONE_ID_BASIC_ID_DATA {
21685 #[doc = "System ID (0 for broadcast)."]
21686 pub target_system: u8,
21687 #[doc = "Component ID (0 for broadcast)."]
21688 pub target_component: u8,
21689 #[doc = "Only used for drone ID data received from other UAs. See detailed description at <https://mavlink.io/en/services/opendroneid.html>."]
21690 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
21691 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
21692 pub id_or_mac: [u8; 20],
21693 #[doc = "Indicates the format for the uas_id field of this message."]
21694 pub id_type: MavOdidIdType,
21695 #[doc = "Indicates the type of UA (Unmanned Aircraft)."]
21696 pub ua_type: MavOdidUaType,
21697 #[doc = "UAS (Unmanned Aircraft System) ID following the format specified by id_type. Shall be filled with nulls in the unused portion of the field."]
21698 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
21699 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
21700 pub uas_id: [u8; 20],
21701}
21702impl OPEN_DRONE_ID_BASIC_ID_DATA {
21703 pub const ENCODED_LEN: usize = 44usize;
21704 pub const DEFAULT: Self = Self {
21705 target_system: 0_u8,
21706 target_component: 0_u8,
21707 id_or_mac: [0_u8; 20usize],
21708 id_type: MavOdidIdType::DEFAULT,
21709 ua_type: MavOdidUaType::DEFAULT,
21710 uas_id: [0_u8; 20usize],
21711 };
21712 #[cfg(feature = "arbitrary")]
21713 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
21714 use arbitrary::{Arbitrary, Unstructured};
21715 let mut buf = [0u8; 1024];
21716 rng.fill_bytes(&mut buf);
21717 let mut unstructured = Unstructured::new(&buf);
21718 Self::arbitrary(&mut unstructured).unwrap_or_default()
21719 }
21720}
21721impl Default for OPEN_DRONE_ID_BASIC_ID_DATA {
21722 fn default() -> Self {
21723 Self::DEFAULT.clone()
21724 }
21725}
21726impl MessageData for OPEN_DRONE_ID_BASIC_ID_DATA {
21727 type Message = MavMessage;
21728 const ID: u32 = 12900u32;
21729 const NAME: &'static str = "OPEN_DRONE_ID_BASIC_ID";
21730 const EXTRA_CRC: u8 = 114u8;
21731 const ENCODED_LEN: usize = 44usize;
21732 fn deser(
21733 _version: MavlinkVersion,
21734 __input: &[u8],
21735 ) -> Result<Self, ::mavlink_core::error::ParserError> {
21736 let avail_len = __input.len();
21737 let mut payload_buf = [0; Self::ENCODED_LEN];
21738 let mut buf = if avail_len < Self::ENCODED_LEN {
21739 payload_buf[0..avail_len].copy_from_slice(__input);
21740 Bytes::new(&payload_buf)
21741 } else {
21742 Bytes::new(__input)
21743 };
21744 let mut __struct = Self::default();
21745 __struct.target_system = buf.get_u8();
21746 __struct.target_component = buf.get_u8();
21747 for v in &mut __struct.id_or_mac {
21748 let val = buf.get_u8();
21749 *v = val;
21750 }
21751 let tmp = buf.get_u8();
21752 __struct.id_type =
21753 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
21754 enum_type: "MavOdidIdType",
21755 value: tmp as u64,
21756 })?;
21757 let tmp = buf.get_u8();
21758 __struct.ua_type =
21759 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
21760 enum_type: "MavOdidUaType",
21761 value: tmp as u64,
21762 })?;
21763 for v in &mut __struct.uas_id {
21764 let val = buf.get_u8();
21765 *v = val;
21766 }
21767 Ok(__struct)
21768 }
21769 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
21770 let mut __tmp = BytesMut::new(bytes);
21771 #[allow(clippy::absurd_extreme_comparisons)]
21772 #[allow(unused_comparisons)]
21773 if __tmp.remaining() < Self::ENCODED_LEN {
21774 panic!(
21775 "buffer is too small (need {} bytes, but got {})",
21776 Self::ENCODED_LEN,
21777 __tmp.remaining(),
21778 )
21779 }
21780 __tmp.put_u8(self.target_system);
21781 __tmp.put_u8(self.target_component);
21782 for val in &self.id_or_mac {
21783 __tmp.put_u8(*val);
21784 }
21785 __tmp.put_u8(self.id_type as u8);
21786 __tmp.put_u8(self.ua_type as u8);
21787 for val in &self.uas_id {
21788 __tmp.put_u8(*val);
21789 }
21790 if matches!(version, MavlinkVersion::V2) {
21791 let len = __tmp.len();
21792 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
21793 } else {
21794 __tmp.len()
21795 }
21796 }
21797}
21798#[doc = "Data for filling the OpenDroneID Location message. The float data types are 32-bit IEEE 754. The Location message provides the location, altitude, direction and speed of the aircraft."]
21799#[doc = ""]
21800#[doc = "ID: 12901"]
21801#[derive(Debug, Clone, PartialEq)]
21802#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
21803#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
21804#[cfg_attr(feature = "ts", derive(TS))]
21805#[cfg_attr(feature = "ts", ts(export))]
21806pub struct OPEN_DRONE_ID_LOCATION_DATA {
21807 #[doc = "Current latitude of the unmanned aircraft. If unknown: 0 (both Lat/Lon)."]
21808 pub latitude: i32,
21809 #[doc = "Current longitude of the unmanned aircraft. If unknown: 0 (both Lat/Lon)."]
21810 pub longitude: i32,
21811 #[doc = "The altitude calculated from the barometric pressue. Reference is against 29.92inHg or 1013.2mb. If unknown: -1000 m."]
21812 pub altitude_barometric: f32,
21813 #[doc = "The geodetic altitude as defined by WGS84. If unknown: -1000 m."]
21814 pub altitude_geodetic: f32,
21815 #[doc = "The current height of the unmanned aircraft above the take-off location or the ground as indicated by height_reference. If unknown: -1000 m."]
21816 pub height: f32,
21817 #[doc = "Seconds after the full hour with reference to UTC time. Typically the GPS outputs a time-of-week value in milliseconds. First convert that to UTC and then convert for this field using ((float) (time_week_ms % (60*60*1000))) / 1000. If unknown: 0xFFFF."]
21818 pub timestamp: f32,
21819 #[doc = "Direction over ground (not heading, but direction of movement) measured clockwise from true North: 0 - 35999 centi-degrees. If unknown: 36100 centi-degrees."]
21820 pub direction: u16,
21821 #[doc = "Ground speed. Positive only. If unknown: 25500 cm/s. If speed is larger than 25425 cm/s, use 25425 cm/s."]
21822 pub speed_horizontal: u16,
21823 #[doc = "The vertical speed. Up is positive. If unknown: 6300 cm/s. If speed is larger than 6200 cm/s, use 6200 cm/s. If lower than -6200 cm/s, use -6200 cm/s."]
21824 pub speed_vertical: i16,
21825 #[doc = "System ID (0 for broadcast)."]
21826 pub target_system: u8,
21827 #[doc = "Component ID (0 for broadcast)."]
21828 pub target_component: u8,
21829 #[doc = "Only used for drone ID data received from other UAs. See detailed description at <https://mavlink.io/en/services/opendroneid.html>."]
21830 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
21831 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
21832 pub id_or_mac: [u8; 20],
21833 #[doc = "Indicates whether the unmanned aircraft is on the ground or in the air."]
21834 pub status: MavOdidStatus,
21835 #[doc = "Indicates the reference point for the height field."]
21836 pub height_reference: MavOdidHeightRef,
21837 #[doc = "The accuracy of the horizontal position."]
21838 pub horizontal_accuracy: MavOdidHorAcc,
21839 #[doc = "The accuracy of the vertical position."]
21840 pub vertical_accuracy: MavOdidVerAcc,
21841 #[doc = "The accuracy of the barometric altitude."]
21842 pub barometer_accuracy: MavOdidVerAcc,
21843 #[doc = "The accuracy of the horizontal and vertical speed."]
21844 pub speed_accuracy: MavOdidSpeedAcc,
21845 #[doc = "The accuracy of the timestamps."]
21846 pub timestamp_accuracy: MavOdidTimeAcc,
21847}
21848impl OPEN_DRONE_ID_LOCATION_DATA {
21849 pub const ENCODED_LEN: usize = 59usize;
21850 pub const DEFAULT: Self = Self {
21851 latitude: 0_i32,
21852 longitude: 0_i32,
21853 altitude_barometric: 0.0_f32,
21854 altitude_geodetic: 0.0_f32,
21855 height: 0.0_f32,
21856 timestamp: 0.0_f32,
21857 direction: 0_u16,
21858 speed_horizontal: 0_u16,
21859 speed_vertical: 0_i16,
21860 target_system: 0_u8,
21861 target_component: 0_u8,
21862 id_or_mac: [0_u8; 20usize],
21863 status: MavOdidStatus::DEFAULT,
21864 height_reference: MavOdidHeightRef::DEFAULT,
21865 horizontal_accuracy: MavOdidHorAcc::DEFAULT,
21866 vertical_accuracy: MavOdidVerAcc::DEFAULT,
21867 barometer_accuracy: MavOdidVerAcc::DEFAULT,
21868 speed_accuracy: MavOdidSpeedAcc::DEFAULT,
21869 timestamp_accuracy: MavOdidTimeAcc::DEFAULT,
21870 };
21871 #[cfg(feature = "arbitrary")]
21872 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
21873 use arbitrary::{Arbitrary, Unstructured};
21874 let mut buf = [0u8; 1024];
21875 rng.fill_bytes(&mut buf);
21876 let mut unstructured = Unstructured::new(&buf);
21877 Self::arbitrary(&mut unstructured).unwrap_or_default()
21878 }
21879}
21880impl Default for OPEN_DRONE_ID_LOCATION_DATA {
21881 fn default() -> Self {
21882 Self::DEFAULT.clone()
21883 }
21884}
21885impl MessageData for OPEN_DRONE_ID_LOCATION_DATA {
21886 type Message = MavMessage;
21887 const ID: u32 = 12901u32;
21888 const NAME: &'static str = "OPEN_DRONE_ID_LOCATION";
21889 const EXTRA_CRC: u8 = 254u8;
21890 const ENCODED_LEN: usize = 59usize;
21891 fn deser(
21892 _version: MavlinkVersion,
21893 __input: &[u8],
21894 ) -> Result<Self, ::mavlink_core::error::ParserError> {
21895 let avail_len = __input.len();
21896 let mut payload_buf = [0; Self::ENCODED_LEN];
21897 let mut buf = if avail_len < Self::ENCODED_LEN {
21898 payload_buf[0..avail_len].copy_from_slice(__input);
21899 Bytes::new(&payload_buf)
21900 } else {
21901 Bytes::new(__input)
21902 };
21903 let mut __struct = Self::default();
21904 __struct.latitude = buf.get_i32_le();
21905 __struct.longitude = buf.get_i32_le();
21906 __struct.altitude_barometric = buf.get_f32_le();
21907 __struct.altitude_geodetic = buf.get_f32_le();
21908 __struct.height = buf.get_f32_le();
21909 __struct.timestamp = buf.get_f32_le();
21910 __struct.direction = buf.get_u16_le();
21911 __struct.speed_horizontal = buf.get_u16_le();
21912 __struct.speed_vertical = buf.get_i16_le();
21913 __struct.target_system = buf.get_u8();
21914 __struct.target_component = buf.get_u8();
21915 for v in &mut __struct.id_or_mac {
21916 let val = buf.get_u8();
21917 *v = val;
21918 }
21919 let tmp = buf.get_u8();
21920 __struct.status =
21921 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
21922 enum_type: "MavOdidStatus",
21923 value: tmp as u64,
21924 })?;
21925 let tmp = buf.get_u8();
21926 __struct.height_reference =
21927 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
21928 enum_type: "MavOdidHeightRef",
21929 value: tmp as u64,
21930 })?;
21931 let tmp = buf.get_u8();
21932 __struct.horizontal_accuracy =
21933 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
21934 enum_type: "MavOdidHorAcc",
21935 value: tmp as u64,
21936 })?;
21937 let tmp = buf.get_u8();
21938 __struct.vertical_accuracy =
21939 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
21940 enum_type: "MavOdidVerAcc",
21941 value: tmp as u64,
21942 })?;
21943 let tmp = buf.get_u8();
21944 __struct.barometer_accuracy =
21945 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
21946 enum_type: "MavOdidVerAcc",
21947 value: tmp as u64,
21948 })?;
21949 let tmp = buf.get_u8();
21950 __struct.speed_accuracy =
21951 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
21952 enum_type: "MavOdidSpeedAcc",
21953 value: tmp as u64,
21954 })?;
21955 let tmp = buf.get_u8();
21956 __struct.timestamp_accuracy =
21957 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
21958 enum_type: "MavOdidTimeAcc",
21959 value: tmp as u64,
21960 })?;
21961 Ok(__struct)
21962 }
21963 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
21964 let mut __tmp = BytesMut::new(bytes);
21965 #[allow(clippy::absurd_extreme_comparisons)]
21966 #[allow(unused_comparisons)]
21967 if __tmp.remaining() < Self::ENCODED_LEN {
21968 panic!(
21969 "buffer is too small (need {} bytes, but got {})",
21970 Self::ENCODED_LEN,
21971 __tmp.remaining(),
21972 )
21973 }
21974 __tmp.put_i32_le(self.latitude);
21975 __tmp.put_i32_le(self.longitude);
21976 __tmp.put_f32_le(self.altitude_barometric);
21977 __tmp.put_f32_le(self.altitude_geodetic);
21978 __tmp.put_f32_le(self.height);
21979 __tmp.put_f32_le(self.timestamp);
21980 __tmp.put_u16_le(self.direction);
21981 __tmp.put_u16_le(self.speed_horizontal);
21982 __tmp.put_i16_le(self.speed_vertical);
21983 __tmp.put_u8(self.target_system);
21984 __tmp.put_u8(self.target_component);
21985 for val in &self.id_or_mac {
21986 __tmp.put_u8(*val);
21987 }
21988 __tmp.put_u8(self.status as u8);
21989 __tmp.put_u8(self.height_reference as u8);
21990 __tmp.put_u8(self.horizontal_accuracy as u8);
21991 __tmp.put_u8(self.vertical_accuracy as u8);
21992 __tmp.put_u8(self.barometer_accuracy as u8);
21993 __tmp.put_u8(self.speed_accuracy as u8);
21994 __tmp.put_u8(self.timestamp_accuracy as u8);
21995 if matches!(version, MavlinkVersion::V2) {
21996 let len = __tmp.len();
21997 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
21998 } else {
21999 __tmp.len()
22000 }
22001 }
22002}
22003#[doc = "An OpenDroneID message pack is a container for multiple encoded OpenDroneID messages (i.e. not in the format given for the above message descriptions but after encoding into the compressed OpenDroneID byte format). Used e.g. when transmitting on Bluetooth 5.0 Long Range/Extended Advertising or on WiFi Neighbor Aware Networking or on WiFi Beacon."]
22004#[doc = ""]
22005#[doc = "ID: 12915"]
22006#[derive(Debug, Clone, PartialEq)]
22007#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
22008#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
22009#[cfg_attr(feature = "ts", derive(TS))]
22010#[cfg_attr(feature = "ts", ts(export))]
22011pub struct OPEN_DRONE_ID_MESSAGE_PACK_DATA {
22012 #[doc = "System ID (0 for broadcast)."]
22013 pub target_system: u8,
22014 #[doc = "Component ID (0 for broadcast)."]
22015 pub target_component: u8,
22016 #[doc = "Only used for drone ID data received from other UAs. See detailed description at <https://mavlink.io/en/services/opendroneid.html>."]
22017 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
22018 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
22019 pub id_or_mac: [u8; 20],
22020 #[doc = "This field must currently always be equal to 25 (bytes), since all encoded OpenDroneID messages are specified to have this length."]
22021 pub single_message_size: u8,
22022 #[doc = "Number of encoded messages in the pack (not the number of bytes). Allowed range is 1 - 9."]
22023 pub msg_pack_size: u8,
22024 #[doc = "Concatenation of encoded OpenDroneID messages. Shall be filled with nulls in the unused portion of the field."]
22025 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
22026 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
22027 pub messages: [u8; 225],
22028}
22029impl OPEN_DRONE_ID_MESSAGE_PACK_DATA {
22030 pub const ENCODED_LEN: usize = 249usize;
22031 pub const DEFAULT: Self = Self {
22032 target_system: 0_u8,
22033 target_component: 0_u8,
22034 id_or_mac: [0_u8; 20usize],
22035 single_message_size: 0_u8,
22036 msg_pack_size: 0_u8,
22037 messages: [0_u8; 225usize],
22038 };
22039 #[cfg(feature = "arbitrary")]
22040 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
22041 use arbitrary::{Arbitrary, Unstructured};
22042 let mut buf = [0u8; 1024];
22043 rng.fill_bytes(&mut buf);
22044 let mut unstructured = Unstructured::new(&buf);
22045 Self::arbitrary(&mut unstructured).unwrap_or_default()
22046 }
22047}
22048impl Default for OPEN_DRONE_ID_MESSAGE_PACK_DATA {
22049 fn default() -> Self {
22050 Self::DEFAULT.clone()
22051 }
22052}
22053impl MessageData for OPEN_DRONE_ID_MESSAGE_PACK_DATA {
22054 type Message = MavMessage;
22055 const ID: u32 = 12915u32;
22056 const NAME: &'static str = "OPEN_DRONE_ID_MESSAGE_PACK";
22057 const EXTRA_CRC: u8 = 94u8;
22058 const ENCODED_LEN: usize = 249usize;
22059 fn deser(
22060 _version: MavlinkVersion,
22061 __input: &[u8],
22062 ) -> Result<Self, ::mavlink_core::error::ParserError> {
22063 let avail_len = __input.len();
22064 let mut payload_buf = [0; Self::ENCODED_LEN];
22065 let mut buf = if avail_len < Self::ENCODED_LEN {
22066 payload_buf[0..avail_len].copy_from_slice(__input);
22067 Bytes::new(&payload_buf)
22068 } else {
22069 Bytes::new(__input)
22070 };
22071 let mut __struct = Self::default();
22072 __struct.target_system = buf.get_u8();
22073 __struct.target_component = buf.get_u8();
22074 for v in &mut __struct.id_or_mac {
22075 let val = buf.get_u8();
22076 *v = val;
22077 }
22078 __struct.single_message_size = buf.get_u8();
22079 __struct.msg_pack_size = buf.get_u8();
22080 for v in &mut __struct.messages {
22081 let val = buf.get_u8();
22082 *v = val;
22083 }
22084 Ok(__struct)
22085 }
22086 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
22087 let mut __tmp = BytesMut::new(bytes);
22088 #[allow(clippy::absurd_extreme_comparisons)]
22089 #[allow(unused_comparisons)]
22090 if __tmp.remaining() < Self::ENCODED_LEN {
22091 panic!(
22092 "buffer is too small (need {} bytes, but got {})",
22093 Self::ENCODED_LEN,
22094 __tmp.remaining(),
22095 )
22096 }
22097 __tmp.put_u8(self.target_system);
22098 __tmp.put_u8(self.target_component);
22099 for val in &self.id_or_mac {
22100 __tmp.put_u8(*val);
22101 }
22102 __tmp.put_u8(self.single_message_size);
22103 __tmp.put_u8(self.msg_pack_size);
22104 for val in &self.messages {
22105 __tmp.put_u8(*val);
22106 }
22107 if matches!(version, MavlinkVersion::V2) {
22108 let len = __tmp.len();
22109 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
22110 } else {
22111 __tmp.len()
22112 }
22113 }
22114}
22115#[doc = "Data for filling the OpenDroneID Operator ID message, which contains the CAA (Civil Aviation Authority) issued operator ID."]
22116#[doc = ""]
22117#[doc = "ID: 12905"]
22118#[derive(Debug, Clone, PartialEq)]
22119#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
22120#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
22121#[cfg_attr(feature = "ts", derive(TS))]
22122#[cfg_attr(feature = "ts", ts(export))]
22123pub struct OPEN_DRONE_ID_OPERATOR_ID_DATA {
22124 #[doc = "System ID (0 for broadcast)."]
22125 pub target_system: u8,
22126 #[doc = "Component ID (0 for broadcast)."]
22127 pub target_component: u8,
22128 #[doc = "Only used for drone ID data received from other UAs. See detailed description at <https://mavlink.io/en/services/opendroneid.html>."]
22129 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
22130 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
22131 pub id_or_mac: [u8; 20],
22132 #[doc = "Indicates the type of the operator_id field."]
22133 pub operator_id_type: MavOdidOperatorIdType,
22134 #[doc = "Text description or numeric value expressed as ASCII characters. Shall be filled with nulls in the unused portion of the field."]
22135 #[cfg_attr(feature = "ts", ts(type = "string"))]
22136 pub operator_id: CharArray<20>,
22137}
22138impl OPEN_DRONE_ID_OPERATOR_ID_DATA {
22139 pub const ENCODED_LEN: usize = 43usize;
22140 pub const DEFAULT: Self = Self {
22141 target_system: 0_u8,
22142 target_component: 0_u8,
22143 id_or_mac: [0_u8; 20usize],
22144 operator_id_type: MavOdidOperatorIdType::DEFAULT,
22145 operator_id: CharArray::new([0_u8; 20usize]),
22146 };
22147 #[cfg(feature = "arbitrary")]
22148 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
22149 use arbitrary::{Arbitrary, Unstructured};
22150 let mut buf = [0u8; 1024];
22151 rng.fill_bytes(&mut buf);
22152 let mut unstructured = Unstructured::new(&buf);
22153 Self::arbitrary(&mut unstructured).unwrap_or_default()
22154 }
22155}
22156impl Default for OPEN_DRONE_ID_OPERATOR_ID_DATA {
22157 fn default() -> Self {
22158 Self::DEFAULT.clone()
22159 }
22160}
22161impl MessageData for OPEN_DRONE_ID_OPERATOR_ID_DATA {
22162 type Message = MavMessage;
22163 const ID: u32 = 12905u32;
22164 const NAME: &'static str = "OPEN_DRONE_ID_OPERATOR_ID";
22165 const EXTRA_CRC: u8 = 49u8;
22166 const ENCODED_LEN: usize = 43usize;
22167 fn deser(
22168 _version: MavlinkVersion,
22169 __input: &[u8],
22170 ) -> Result<Self, ::mavlink_core::error::ParserError> {
22171 let avail_len = __input.len();
22172 let mut payload_buf = [0; Self::ENCODED_LEN];
22173 let mut buf = if avail_len < Self::ENCODED_LEN {
22174 payload_buf[0..avail_len].copy_from_slice(__input);
22175 Bytes::new(&payload_buf)
22176 } else {
22177 Bytes::new(__input)
22178 };
22179 let mut __struct = Self::default();
22180 __struct.target_system = buf.get_u8();
22181 __struct.target_component = buf.get_u8();
22182 for v in &mut __struct.id_or_mac {
22183 let val = buf.get_u8();
22184 *v = val;
22185 }
22186 let tmp = buf.get_u8();
22187 __struct.operator_id_type =
22188 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
22189 enum_type: "MavOdidOperatorIdType",
22190 value: tmp as u64,
22191 })?;
22192 let mut tmp = [0_u8; 20usize];
22193 for v in &mut tmp {
22194 *v = buf.get_u8();
22195 }
22196 __struct.operator_id = CharArray::new(tmp);
22197 Ok(__struct)
22198 }
22199 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
22200 let mut __tmp = BytesMut::new(bytes);
22201 #[allow(clippy::absurd_extreme_comparisons)]
22202 #[allow(unused_comparisons)]
22203 if __tmp.remaining() < Self::ENCODED_LEN {
22204 panic!(
22205 "buffer is too small (need {} bytes, but got {})",
22206 Self::ENCODED_LEN,
22207 __tmp.remaining(),
22208 )
22209 }
22210 __tmp.put_u8(self.target_system);
22211 __tmp.put_u8(self.target_component);
22212 for val in &self.id_or_mac {
22213 __tmp.put_u8(*val);
22214 }
22215 __tmp.put_u8(self.operator_id_type as u8);
22216 for val in &self.operator_id {
22217 __tmp.put_u8(*val);
22218 }
22219 if matches!(version, MavlinkVersion::V2) {
22220 let len = __tmp.len();
22221 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
22222 } else {
22223 __tmp.len()
22224 }
22225 }
22226}
22227#[doc = "Data for filling the OpenDroneID Self ID message. The Self ID Message is an opportunity for the operator to (optionally) declare their identity and purpose of the flight. This message can provide additional information that could reduce the threat profile of a UA (Unmanned Aircraft) flying in a particular area or manner. This message can also be used to provide optional additional clarification in an emergency/remote ID system failure situation."]
22228#[doc = ""]
22229#[doc = "ID: 12903"]
22230#[derive(Debug, Clone, PartialEq)]
22231#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
22232#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
22233#[cfg_attr(feature = "ts", derive(TS))]
22234#[cfg_attr(feature = "ts", ts(export))]
22235pub struct OPEN_DRONE_ID_SELF_ID_DATA {
22236 #[doc = "System ID (0 for broadcast)."]
22237 pub target_system: u8,
22238 #[doc = "Component ID (0 for broadcast)."]
22239 pub target_component: u8,
22240 #[doc = "Only used for drone ID data received from other UAs. See detailed description at <https://mavlink.io/en/services/opendroneid.html>."]
22241 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
22242 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
22243 pub id_or_mac: [u8; 20],
22244 #[doc = "Indicates the type of the description field."]
22245 pub description_type: MavOdidDescType,
22246 #[doc = "Text description or numeric value expressed as ASCII characters. Shall be filled with nulls in the unused portion of the field."]
22247 #[cfg_attr(feature = "ts", ts(type = "string"))]
22248 pub description: CharArray<23>,
22249}
22250impl OPEN_DRONE_ID_SELF_ID_DATA {
22251 pub const ENCODED_LEN: usize = 46usize;
22252 pub const DEFAULT: Self = Self {
22253 target_system: 0_u8,
22254 target_component: 0_u8,
22255 id_or_mac: [0_u8; 20usize],
22256 description_type: MavOdidDescType::DEFAULT,
22257 description: CharArray::new([0_u8; 23usize]),
22258 };
22259 #[cfg(feature = "arbitrary")]
22260 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
22261 use arbitrary::{Arbitrary, Unstructured};
22262 let mut buf = [0u8; 1024];
22263 rng.fill_bytes(&mut buf);
22264 let mut unstructured = Unstructured::new(&buf);
22265 Self::arbitrary(&mut unstructured).unwrap_or_default()
22266 }
22267}
22268impl Default for OPEN_DRONE_ID_SELF_ID_DATA {
22269 fn default() -> Self {
22270 Self::DEFAULT.clone()
22271 }
22272}
22273impl MessageData for OPEN_DRONE_ID_SELF_ID_DATA {
22274 type Message = MavMessage;
22275 const ID: u32 = 12903u32;
22276 const NAME: &'static str = "OPEN_DRONE_ID_SELF_ID";
22277 const EXTRA_CRC: u8 = 249u8;
22278 const ENCODED_LEN: usize = 46usize;
22279 fn deser(
22280 _version: MavlinkVersion,
22281 __input: &[u8],
22282 ) -> Result<Self, ::mavlink_core::error::ParserError> {
22283 let avail_len = __input.len();
22284 let mut payload_buf = [0; Self::ENCODED_LEN];
22285 let mut buf = if avail_len < Self::ENCODED_LEN {
22286 payload_buf[0..avail_len].copy_from_slice(__input);
22287 Bytes::new(&payload_buf)
22288 } else {
22289 Bytes::new(__input)
22290 };
22291 let mut __struct = Self::default();
22292 __struct.target_system = buf.get_u8();
22293 __struct.target_component = buf.get_u8();
22294 for v in &mut __struct.id_or_mac {
22295 let val = buf.get_u8();
22296 *v = val;
22297 }
22298 let tmp = buf.get_u8();
22299 __struct.description_type =
22300 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
22301 enum_type: "MavOdidDescType",
22302 value: tmp as u64,
22303 })?;
22304 let mut tmp = [0_u8; 23usize];
22305 for v in &mut tmp {
22306 *v = buf.get_u8();
22307 }
22308 __struct.description = CharArray::new(tmp);
22309 Ok(__struct)
22310 }
22311 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
22312 let mut __tmp = BytesMut::new(bytes);
22313 #[allow(clippy::absurd_extreme_comparisons)]
22314 #[allow(unused_comparisons)]
22315 if __tmp.remaining() < Self::ENCODED_LEN {
22316 panic!(
22317 "buffer is too small (need {} bytes, but got {})",
22318 Self::ENCODED_LEN,
22319 __tmp.remaining(),
22320 )
22321 }
22322 __tmp.put_u8(self.target_system);
22323 __tmp.put_u8(self.target_component);
22324 for val in &self.id_or_mac {
22325 __tmp.put_u8(*val);
22326 }
22327 __tmp.put_u8(self.description_type as u8);
22328 for val in &self.description {
22329 __tmp.put_u8(*val);
22330 }
22331 if matches!(version, MavlinkVersion::V2) {
22332 let len = __tmp.len();
22333 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
22334 } else {
22335 __tmp.len()
22336 }
22337 }
22338}
22339#[doc = "Data for filling the OpenDroneID System message. The System Message contains general system information including the operator location/altitude and possible aircraft group and/or category/class information."]
22340#[doc = ""]
22341#[doc = "ID: 12904"]
22342#[derive(Debug, Clone, PartialEq)]
22343#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
22344#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
22345#[cfg_attr(feature = "ts", derive(TS))]
22346#[cfg_attr(feature = "ts", ts(export))]
22347pub struct OPEN_DRONE_ID_SYSTEM_DATA {
22348 #[doc = "Latitude of the operator. If unknown: 0 (both Lat/Lon)."]
22349 pub operator_latitude: i32,
22350 #[doc = "Longitude of the operator. If unknown: 0 (both Lat/Lon)."]
22351 pub operator_longitude: i32,
22352 #[doc = "Area Operations Ceiling relative to WGS84. If unknown: -1000 m. Used only for swarms/multiple UA."]
22353 pub area_ceiling: f32,
22354 #[doc = "Area Operations Floor relative to WGS84. If unknown: -1000 m. Used only for swarms/multiple UA."]
22355 pub area_floor: f32,
22356 #[doc = "Geodetic altitude of the operator relative to WGS84. If unknown: -1000 m."]
22357 pub operator_altitude_geo: f32,
22358 #[doc = "32 bit Unix Timestamp in seconds since 00:00:00 01/01/2019."]
22359 pub timestamp: u32,
22360 #[doc = "Number of aircraft in the area, group or formation (default 1). Used only for swarms/multiple UA."]
22361 pub area_count: u16,
22362 #[doc = "Radius of the cylindrical area of the group or formation (default 0). Used only for swarms/multiple UA."]
22363 pub area_radius: u16,
22364 #[doc = "System ID (0 for broadcast)."]
22365 pub target_system: u8,
22366 #[doc = "Component ID (0 for broadcast)."]
22367 pub target_component: u8,
22368 #[doc = "Only used for drone ID data received from other UAs. See detailed description at <https://mavlink.io/en/services/opendroneid.html>."]
22369 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
22370 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
22371 pub id_or_mac: [u8; 20],
22372 #[doc = "Specifies the operator location type."]
22373 pub operator_location_type: MavOdidOperatorLocationType,
22374 #[doc = "Specifies the classification type of the UA."]
22375 pub classification_type: MavOdidClassificationType,
22376 #[doc = "When classification_type is MAV_ODID_CLASSIFICATION_TYPE_EU, specifies the category of the UA."]
22377 pub category_eu: MavOdidCategoryEu,
22378 #[doc = "When classification_type is MAV_ODID_CLASSIFICATION_TYPE_EU, specifies the class of the UA."]
22379 pub class_eu: MavOdidClassEu,
22380}
22381impl OPEN_DRONE_ID_SYSTEM_DATA {
22382 pub const ENCODED_LEN: usize = 54usize;
22383 pub const DEFAULT: Self = Self {
22384 operator_latitude: 0_i32,
22385 operator_longitude: 0_i32,
22386 area_ceiling: 0.0_f32,
22387 area_floor: 0.0_f32,
22388 operator_altitude_geo: 0.0_f32,
22389 timestamp: 0_u32,
22390 area_count: 0_u16,
22391 area_radius: 0_u16,
22392 target_system: 0_u8,
22393 target_component: 0_u8,
22394 id_or_mac: [0_u8; 20usize],
22395 operator_location_type: MavOdidOperatorLocationType::DEFAULT,
22396 classification_type: MavOdidClassificationType::DEFAULT,
22397 category_eu: MavOdidCategoryEu::DEFAULT,
22398 class_eu: MavOdidClassEu::DEFAULT,
22399 };
22400 #[cfg(feature = "arbitrary")]
22401 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
22402 use arbitrary::{Arbitrary, Unstructured};
22403 let mut buf = [0u8; 1024];
22404 rng.fill_bytes(&mut buf);
22405 let mut unstructured = Unstructured::new(&buf);
22406 Self::arbitrary(&mut unstructured).unwrap_or_default()
22407 }
22408}
22409impl Default for OPEN_DRONE_ID_SYSTEM_DATA {
22410 fn default() -> Self {
22411 Self::DEFAULT.clone()
22412 }
22413}
22414impl MessageData for OPEN_DRONE_ID_SYSTEM_DATA {
22415 type Message = MavMessage;
22416 const ID: u32 = 12904u32;
22417 const NAME: &'static str = "OPEN_DRONE_ID_SYSTEM";
22418 const EXTRA_CRC: u8 = 77u8;
22419 const ENCODED_LEN: usize = 54usize;
22420 fn deser(
22421 _version: MavlinkVersion,
22422 __input: &[u8],
22423 ) -> Result<Self, ::mavlink_core::error::ParserError> {
22424 let avail_len = __input.len();
22425 let mut payload_buf = [0; Self::ENCODED_LEN];
22426 let mut buf = if avail_len < Self::ENCODED_LEN {
22427 payload_buf[0..avail_len].copy_from_slice(__input);
22428 Bytes::new(&payload_buf)
22429 } else {
22430 Bytes::new(__input)
22431 };
22432 let mut __struct = Self::default();
22433 __struct.operator_latitude = buf.get_i32_le();
22434 __struct.operator_longitude = buf.get_i32_le();
22435 __struct.area_ceiling = buf.get_f32_le();
22436 __struct.area_floor = buf.get_f32_le();
22437 __struct.operator_altitude_geo = buf.get_f32_le();
22438 __struct.timestamp = buf.get_u32_le();
22439 __struct.area_count = buf.get_u16_le();
22440 __struct.area_radius = buf.get_u16_le();
22441 __struct.target_system = buf.get_u8();
22442 __struct.target_component = buf.get_u8();
22443 for v in &mut __struct.id_or_mac {
22444 let val = buf.get_u8();
22445 *v = val;
22446 }
22447 let tmp = buf.get_u8();
22448 __struct.operator_location_type =
22449 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
22450 enum_type: "MavOdidOperatorLocationType",
22451 value: tmp as u64,
22452 })?;
22453 let tmp = buf.get_u8();
22454 __struct.classification_type =
22455 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
22456 enum_type: "MavOdidClassificationType",
22457 value: tmp as u64,
22458 })?;
22459 let tmp = buf.get_u8();
22460 __struct.category_eu =
22461 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
22462 enum_type: "MavOdidCategoryEu",
22463 value: tmp as u64,
22464 })?;
22465 let tmp = buf.get_u8();
22466 __struct.class_eu =
22467 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
22468 enum_type: "MavOdidClassEu",
22469 value: tmp as u64,
22470 })?;
22471 Ok(__struct)
22472 }
22473 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
22474 let mut __tmp = BytesMut::new(bytes);
22475 #[allow(clippy::absurd_extreme_comparisons)]
22476 #[allow(unused_comparisons)]
22477 if __tmp.remaining() < Self::ENCODED_LEN {
22478 panic!(
22479 "buffer is too small (need {} bytes, but got {})",
22480 Self::ENCODED_LEN,
22481 __tmp.remaining(),
22482 )
22483 }
22484 __tmp.put_i32_le(self.operator_latitude);
22485 __tmp.put_i32_le(self.operator_longitude);
22486 __tmp.put_f32_le(self.area_ceiling);
22487 __tmp.put_f32_le(self.area_floor);
22488 __tmp.put_f32_le(self.operator_altitude_geo);
22489 __tmp.put_u32_le(self.timestamp);
22490 __tmp.put_u16_le(self.area_count);
22491 __tmp.put_u16_le(self.area_radius);
22492 __tmp.put_u8(self.target_system);
22493 __tmp.put_u8(self.target_component);
22494 for val in &self.id_or_mac {
22495 __tmp.put_u8(*val);
22496 }
22497 __tmp.put_u8(self.operator_location_type as u8);
22498 __tmp.put_u8(self.classification_type as u8);
22499 __tmp.put_u8(self.category_eu as u8);
22500 __tmp.put_u8(self.class_eu as u8);
22501 if matches!(version, MavlinkVersion::V2) {
22502 let len = __tmp.len();
22503 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
22504 } else {
22505 __tmp.len()
22506 }
22507 }
22508}
22509#[doc = "Update the data in the OPEN_DRONE_ID_SYSTEM message with new location information. This can be sent to update the location information for the operator when no other information in the SYSTEM message has changed. This message allows for efficient operation on radio links which have limited uplink bandwidth while meeting requirements for update frequency of the operator location."]
22510#[doc = ""]
22511#[doc = "ID: 12919"]
22512#[derive(Debug, Clone, PartialEq)]
22513#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
22514#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
22515#[cfg_attr(feature = "ts", derive(TS))]
22516#[cfg_attr(feature = "ts", ts(export))]
22517pub struct OPEN_DRONE_ID_SYSTEM_UPDATE_DATA {
22518 #[doc = "Latitude of the operator. If unknown: 0 (both Lat/Lon)."]
22519 pub operator_latitude: i32,
22520 #[doc = "Longitude of the operator. If unknown: 0 (both Lat/Lon)."]
22521 pub operator_longitude: i32,
22522 #[doc = "Geodetic altitude of the operator relative to WGS84. If unknown: -1000 m."]
22523 pub operator_altitude_geo: f32,
22524 #[doc = "32 bit Unix Timestamp in seconds since 00:00:00 01/01/2019."]
22525 pub timestamp: u32,
22526 #[doc = "System ID (0 for broadcast)."]
22527 pub target_system: u8,
22528 #[doc = "Component ID (0 for broadcast)."]
22529 pub target_component: u8,
22530}
22531impl OPEN_DRONE_ID_SYSTEM_UPDATE_DATA {
22532 pub const ENCODED_LEN: usize = 18usize;
22533 pub const DEFAULT: Self = Self {
22534 operator_latitude: 0_i32,
22535 operator_longitude: 0_i32,
22536 operator_altitude_geo: 0.0_f32,
22537 timestamp: 0_u32,
22538 target_system: 0_u8,
22539 target_component: 0_u8,
22540 };
22541 #[cfg(feature = "arbitrary")]
22542 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
22543 use arbitrary::{Arbitrary, Unstructured};
22544 let mut buf = [0u8; 1024];
22545 rng.fill_bytes(&mut buf);
22546 let mut unstructured = Unstructured::new(&buf);
22547 Self::arbitrary(&mut unstructured).unwrap_or_default()
22548 }
22549}
22550impl Default for OPEN_DRONE_ID_SYSTEM_UPDATE_DATA {
22551 fn default() -> Self {
22552 Self::DEFAULT.clone()
22553 }
22554}
22555impl MessageData for OPEN_DRONE_ID_SYSTEM_UPDATE_DATA {
22556 type Message = MavMessage;
22557 const ID: u32 = 12919u32;
22558 const NAME: &'static str = "OPEN_DRONE_ID_SYSTEM_UPDATE";
22559 const EXTRA_CRC: u8 = 7u8;
22560 const ENCODED_LEN: usize = 18usize;
22561 fn deser(
22562 _version: MavlinkVersion,
22563 __input: &[u8],
22564 ) -> Result<Self, ::mavlink_core::error::ParserError> {
22565 let avail_len = __input.len();
22566 let mut payload_buf = [0; Self::ENCODED_LEN];
22567 let mut buf = if avail_len < Self::ENCODED_LEN {
22568 payload_buf[0..avail_len].copy_from_slice(__input);
22569 Bytes::new(&payload_buf)
22570 } else {
22571 Bytes::new(__input)
22572 };
22573 let mut __struct = Self::default();
22574 __struct.operator_latitude = buf.get_i32_le();
22575 __struct.operator_longitude = buf.get_i32_le();
22576 __struct.operator_altitude_geo = buf.get_f32_le();
22577 __struct.timestamp = buf.get_u32_le();
22578 __struct.target_system = buf.get_u8();
22579 __struct.target_component = buf.get_u8();
22580 Ok(__struct)
22581 }
22582 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
22583 let mut __tmp = BytesMut::new(bytes);
22584 #[allow(clippy::absurd_extreme_comparisons)]
22585 #[allow(unused_comparisons)]
22586 if __tmp.remaining() < Self::ENCODED_LEN {
22587 panic!(
22588 "buffer is too small (need {} bytes, but got {})",
22589 Self::ENCODED_LEN,
22590 __tmp.remaining(),
22591 )
22592 }
22593 __tmp.put_i32_le(self.operator_latitude);
22594 __tmp.put_i32_le(self.operator_longitude);
22595 __tmp.put_f32_le(self.operator_altitude_geo);
22596 __tmp.put_u32_le(self.timestamp);
22597 __tmp.put_u8(self.target_system);
22598 __tmp.put_u8(self.target_component);
22599 if matches!(version, MavlinkVersion::V2) {
22600 let len = __tmp.len();
22601 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
22602 } else {
22603 __tmp.len()
22604 }
22605 }
22606}
22607#[doc = "Optical flow from a flow sensor (e.g. optical mouse sensor)."]
22608#[doc = ""]
22609#[doc = "ID: 100"]
22610#[derive(Debug, Clone, PartialEq)]
22611#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
22612#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
22613#[cfg_attr(feature = "ts", derive(TS))]
22614#[cfg_attr(feature = "ts", ts(export))]
22615pub struct OPTICAL_FLOW_DATA {
22616 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
22617 pub time_usec: u64,
22618 #[doc = "Flow in x-sensor direction, angular-speed compensated"]
22619 pub flow_comp_m_x: f32,
22620 #[doc = "Flow in y-sensor direction, angular-speed compensated"]
22621 pub flow_comp_m_y: f32,
22622 #[doc = "Ground distance. Positive value: distance known. Negative value: Unknown distance"]
22623 pub ground_distance: f32,
22624 #[doc = "Flow in x-sensor direction"]
22625 pub flow_x: i16,
22626 #[doc = "Flow in y-sensor direction"]
22627 pub flow_y: i16,
22628 #[doc = "Sensor ID"]
22629 pub sensor_id: u8,
22630 #[doc = "Optical flow quality / confidence. 0: bad, 255: maximum quality"]
22631 pub quality: u8,
22632 #[doc = "Flow rate about X axis"]
22633 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
22634 pub flow_rate_x: f32,
22635 #[doc = "Flow rate about Y axis"]
22636 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
22637 pub flow_rate_y: f32,
22638}
22639impl OPTICAL_FLOW_DATA {
22640 pub const ENCODED_LEN: usize = 34usize;
22641 pub const DEFAULT: Self = Self {
22642 time_usec: 0_u64,
22643 flow_comp_m_x: 0.0_f32,
22644 flow_comp_m_y: 0.0_f32,
22645 ground_distance: 0.0_f32,
22646 flow_x: 0_i16,
22647 flow_y: 0_i16,
22648 sensor_id: 0_u8,
22649 quality: 0_u8,
22650 flow_rate_x: 0.0_f32,
22651 flow_rate_y: 0.0_f32,
22652 };
22653 #[cfg(feature = "arbitrary")]
22654 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
22655 use arbitrary::{Arbitrary, Unstructured};
22656 let mut buf = [0u8; 1024];
22657 rng.fill_bytes(&mut buf);
22658 let mut unstructured = Unstructured::new(&buf);
22659 Self::arbitrary(&mut unstructured).unwrap_or_default()
22660 }
22661}
22662impl Default for OPTICAL_FLOW_DATA {
22663 fn default() -> Self {
22664 Self::DEFAULT.clone()
22665 }
22666}
22667impl MessageData for OPTICAL_FLOW_DATA {
22668 type Message = MavMessage;
22669 const ID: u32 = 100u32;
22670 const NAME: &'static str = "OPTICAL_FLOW";
22671 const EXTRA_CRC: u8 = 175u8;
22672 const ENCODED_LEN: usize = 34usize;
22673 fn deser(
22674 _version: MavlinkVersion,
22675 __input: &[u8],
22676 ) -> Result<Self, ::mavlink_core::error::ParserError> {
22677 let avail_len = __input.len();
22678 let mut payload_buf = [0; Self::ENCODED_LEN];
22679 let mut buf = if avail_len < Self::ENCODED_LEN {
22680 payload_buf[0..avail_len].copy_from_slice(__input);
22681 Bytes::new(&payload_buf)
22682 } else {
22683 Bytes::new(__input)
22684 };
22685 let mut __struct = Self::default();
22686 __struct.time_usec = buf.get_u64_le();
22687 __struct.flow_comp_m_x = buf.get_f32_le();
22688 __struct.flow_comp_m_y = buf.get_f32_le();
22689 __struct.ground_distance = buf.get_f32_le();
22690 __struct.flow_x = buf.get_i16_le();
22691 __struct.flow_y = buf.get_i16_le();
22692 __struct.sensor_id = buf.get_u8();
22693 __struct.quality = buf.get_u8();
22694 __struct.flow_rate_x = buf.get_f32_le();
22695 __struct.flow_rate_y = buf.get_f32_le();
22696 Ok(__struct)
22697 }
22698 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
22699 let mut __tmp = BytesMut::new(bytes);
22700 #[allow(clippy::absurd_extreme_comparisons)]
22701 #[allow(unused_comparisons)]
22702 if __tmp.remaining() < Self::ENCODED_LEN {
22703 panic!(
22704 "buffer is too small (need {} bytes, but got {})",
22705 Self::ENCODED_LEN,
22706 __tmp.remaining(),
22707 )
22708 }
22709 __tmp.put_u64_le(self.time_usec);
22710 __tmp.put_f32_le(self.flow_comp_m_x);
22711 __tmp.put_f32_le(self.flow_comp_m_y);
22712 __tmp.put_f32_le(self.ground_distance);
22713 __tmp.put_i16_le(self.flow_x);
22714 __tmp.put_i16_le(self.flow_y);
22715 __tmp.put_u8(self.sensor_id);
22716 __tmp.put_u8(self.quality);
22717 if matches!(version, MavlinkVersion::V2) {
22718 __tmp.put_f32_le(self.flow_rate_x);
22719 __tmp.put_f32_le(self.flow_rate_y);
22720 let len = __tmp.len();
22721 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
22722 } else {
22723 __tmp.len()
22724 }
22725 }
22726}
22727#[doc = "Optical flow from an angular rate flow sensor (e.g. PX4FLOW or mouse sensor)."]
22728#[doc = ""]
22729#[doc = "ID: 106"]
22730#[derive(Debug, Clone, PartialEq)]
22731#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
22732#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
22733#[cfg_attr(feature = "ts", derive(TS))]
22734#[cfg_attr(feature = "ts", ts(export))]
22735pub struct OPTICAL_FLOW_RAD_DATA {
22736 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
22737 pub time_usec: u64,
22738 #[doc = "Integration time. Divide integrated_x and integrated_y by the integration time to obtain average flow. The integration time also indicates the."]
22739 pub integration_time_us: u32,
22740 #[doc = "Flow around X axis (Sensor RH rotation about the X axis induces a positive flow. Sensor linear motion along the positive Y axis induces a negative flow.)"]
22741 pub integrated_x: f32,
22742 #[doc = "Flow around Y axis (Sensor RH rotation about the Y axis induces a positive flow. Sensor linear motion along the positive X axis induces a positive flow.)"]
22743 pub integrated_y: f32,
22744 #[doc = "RH rotation around X axis"]
22745 pub integrated_xgyro: f32,
22746 #[doc = "RH rotation around Y axis"]
22747 pub integrated_ygyro: f32,
22748 #[doc = "RH rotation around Z axis"]
22749 pub integrated_zgyro: f32,
22750 #[doc = "Time since the distance was sampled."]
22751 pub time_delta_distance_us: u32,
22752 #[doc = "Distance to the center of the flow field. Positive value (including zero): distance known. Negative value: Unknown distance."]
22753 pub distance: f32,
22754 #[doc = "Temperature"]
22755 pub temperature: i16,
22756 #[doc = "Sensor ID"]
22757 pub sensor_id: u8,
22758 #[doc = "Optical flow quality / confidence. 0: no valid flow, 255: maximum quality"]
22759 pub quality: u8,
22760}
22761impl OPTICAL_FLOW_RAD_DATA {
22762 pub const ENCODED_LEN: usize = 44usize;
22763 pub const DEFAULT: Self = Self {
22764 time_usec: 0_u64,
22765 integration_time_us: 0_u32,
22766 integrated_x: 0.0_f32,
22767 integrated_y: 0.0_f32,
22768 integrated_xgyro: 0.0_f32,
22769 integrated_ygyro: 0.0_f32,
22770 integrated_zgyro: 0.0_f32,
22771 time_delta_distance_us: 0_u32,
22772 distance: 0.0_f32,
22773 temperature: 0_i16,
22774 sensor_id: 0_u8,
22775 quality: 0_u8,
22776 };
22777 #[cfg(feature = "arbitrary")]
22778 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
22779 use arbitrary::{Arbitrary, Unstructured};
22780 let mut buf = [0u8; 1024];
22781 rng.fill_bytes(&mut buf);
22782 let mut unstructured = Unstructured::new(&buf);
22783 Self::arbitrary(&mut unstructured).unwrap_or_default()
22784 }
22785}
22786impl Default for OPTICAL_FLOW_RAD_DATA {
22787 fn default() -> Self {
22788 Self::DEFAULT.clone()
22789 }
22790}
22791impl MessageData for OPTICAL_FLOW_RAD_DATA {
22792 type Message = MavMessage;
22793 const ID: u32 = 106u32;
22794 const NAME: &'static str = "OPTICAL_FLOW_RAD";
22795 const EXTRA_CRC: u8 = 138u8;
22796 const ENCODED_LEN: usize = 44usize;
22797 fn deser(
22798 _version: MavlinkVersion,
22799 __input: &[u8],
22800 ) -> Result<Self, ::mavlink_core::error::ParserError> {
22801 let avail_len = __input.len();
22802 let mut payload_buf = [0; Self::ENCODED_LEN];
22803 let mut buf = if avail_len < Self::ENCODED_LEN {
22804 payload_buf[0..avail_len].copy_from_slice(__input);
22805 Bytes::new(&payload_buf)
22806 } else {
22807 Bytes::new(__input)
22808 };
22809 let mut __struct = Self::default();
22810 __struct.time_usec = buf.get_u64_le();
22811 __struct.integration_time_us = buf.get_u32_le();
22812 __struct.integrated_x = buf.get_f32_le();
22813 __struct.integrated_y = buf.get_f32_le();
22814 __struct.integrated_xgyro = buf.get_f32_le();
22815 __struct.integrated_ygyro = buf.get_f32_le();
22816 __struct.integrated_zgyro = buf.get_f32_le();
22817 __struct.time_delta_distance_us = buf.get_u32_le();
22818 __struct.distance = buf.get_f32_le();
22819 __struct.temperature = buf.get_i16_le();
22820 __struct.sensor_id = buf.get_u8();
22821 __struct.quality = buf.get_u8();
22822 Ok(__struct)
22823 }
22824 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
22825 let mut __tmp = BytesMut::new(bytes);
22826 #[allow(clippy::absurd_extreme_comparisons)]
22827 #[allow(unused_comparisons)]
22828 if __tmp.remaining() < Self::ENCODED_LEN {
22829 panic!(
22830 "buffer is too small (need {} bytes, but got {})",
22831 Self::ENCODED_LEN,
22832 __tmp.remaining(),
22833 )
22834 }
22835 __tmp.put_u64_le(self.time_usec);
22836 __tmp.put_u32_le(self.integration_time_us);
22837 __tmp.put_f32_le(self.integrated_x);
22838 __tmp.put_f32_le(self.integrated_y);
22839 __tmp.put_f32_le(self.integrated_xgyro);
22840 __tmp.put_f32_le(self.integrated_ygyro);
22841 __tmp.put_f32_le(self.integrated_zgyro);
22842 __tmp.put_u32_le(self.time_delta_distance_us);
22843 __tmp.put_f32_le(self.distance);
22844 __tmp.put_i16_le(self.temperature);
22845 __tmp.put_u8(self.sensor_id);
22846 __tmp.put_u8(self.quality);
22847 if matches!(version, MavlinkVersion::V2) {
22848 let len = __tmp.len();
22849 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
22850 } else {
22851 __tmp.len()
22852 }
22853 }
22854}
22855#[doc = "Vehicle status report that is sent out while orbit execution is in progress (see MAV_CMD_DO_ORBIT)."]
22856#[doc = ""]
22857#[doc = "ID: 360"]
22858#[derive(Debug, Clone, PartialEq)]
22859#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
22860#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
22861#[cfg_attr(feature = "ts", derive(TS))]
22862#[cfg_attr(feature = "ts", ts(export))]
22863pub struct ORBIT_EXECUTION_STATUS_DATA {
22864 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
22865 pub time_usec: u64,
22866 #[doc = "Radius of the orbit circle. Positive values orbit clockwise, negative values orbit counter-clockwise."]
22867 pub radius: f32,
22868 #[doc = "X coordinate of center point. Coordinate system depends on frame field: local = x position in meters * 1e4, global = latitude in degrees * 1e7."]
22869 pub x: i32,
22870 #[doc = "Y coordinate of center point. Coordinate system depends on frame field: local = x position in meters * 1e4, global = latitude in degrees * 1e7."]
22871 pub y: i32,
22872 #[doc = "Altitude of center point. Coordinate system depends on frame field."]
22873 pub z: f32,
22874 #[doc = "The coordinate system of the fields: x, y, z."]
22875 pub frame: MavFrame,
22876}
22877impl ORBIT_EXECUTION_STATUS_DATA {
22878 pub const ENCODED_LEN: usize = 25usize;
22879 pub const DEFAULT: Self = Self {
22880 time_usec: 0_u64,
22881 radius: 0.0_f32,
22882 x: 0_i32,
22883 y: 0_i32,
22884 z: 0.0_f32,
22885 frame: MavFrame::DEFAULT,
22886 };
22887 #[cfg(feature = "arbitrary")]
22888 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
22889 use arbitrary::{Arbitrary, Unstructured};
22890 let mut buf = [0u8; 1024];
22891 rng.fill_bytes(&mut buf);
22892 let mut unstructured = Unstructured::new(&buf);
22893 Self::arbitrary(&mut unstructured).unwrap_or_default()
22894 }
22895}
22896impl Default for ORBIT_EXECUTION_STATUS_DATA {
22897 fn default() -> Self {
22898 Self::DEFAULT.clone()
22899 }
22900}
22901impl MessageData for ORBIT_EXECUTION_STATUS_DATA {
22902 type Message = MavMessage;
22903 const ID: u32 = 360u32;
22904 const NAME: &'static str = "ORBIT_EXECUTION_STATUS";
22905 const EXTRA_CRC: u8 = 11u8;
22906 const ENCODED_LEN: usize = 25usize;
22907 fn deser(
22908 _version: MavlinkVersion,
22909 __input: &[u8],
22910 ) -> Result<Self, ::mavlink_core::error::ParserError> {
22911 let avail_len = __input.len();
22912 let mut payload_buf = [0; Self::ENCODED_LEN];
22913 let mut buf = if avail_len < Self::ENCODED_LEN {
22914 payload_buf[0..avail_len].copy_from_slice(__input);
22915 Bytes::new(&payload_buf)
22916 } else {
22917 Bytes::new(__input)
22918 };
22919 let mut __struct = Self::default();
22920 __struct.time_usec = buf.get_u64_le();
22921 __struct.radius = buf.get_f32_le();
22922 __struct.x = buf.get_i32_le();
22923 __struct.y = buf.get_i32_le();
22924 __struct.z = buf.get_f32_le();
22925 let tmp = buf.get_u8();
22926 __struct.frame =
22927 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
22928 enum_type: "MavFrame",
22929 value: tmp as u64,
22930 })?;
22931 Ok(__struct)
22932 }
22933 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
22934 let mut __tmp = BytesMut::new(bytes);
22935 #[allow(clippy::absurd_extreme_comparisons)]
22936 #[allow(unused_comparisons)]
22937 if __tmp.remaining() < Self::ENCODED_LEN {
22938 panic!(
22939 "buffer is too small (need {} bytes, but got {})",
22940 Self::ENCODED_LEN,
22941 __tmp.remaining(),
22942 )
22943 }
22944 __tmp.put_u64_le(self.time_usec);
22945 __tmp.put_f32_le(self.radius);
22946 __tmp.put_i32_le(self.x);
22947 __tmp.put_i32_le(self.y);
22948 __tmp.put_f32_le(self.z);
22949 __tmp.put_u8(self.frame as u8);
22950 if matches!(version, MavlinkVersion::V2) {
22951 let len = __tmp.len();
22952 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
22953 } else {
22954 __tmp.len()
22955 }
22956 }
22957}
22958#[doc = "Response from a PARAM_EXT_SET message."]
22959#[doc = ""]
22960#[doc = "ID: 324"]
22961#[derive(Debug, Clone, PartialEq)]
22962#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
22963#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
22964#[cfg_attr(feature = "ts", derive(TS))]
22965#[cfg_attr(feature = "ts", ts(export))]
22966pub struct PARAM_EXT_ACK_DATA {
22967 #[doc = "Parameter id, terminated by NULL if the length is less than 16 human-readable chars and WITHOUT null termination (NULL) byte if the length is exactly 16 chars - applications have to provide 16+1 bytes storage if the ID is stored as string"]
22968 #[cfg_attr(feature = "ts", ts(type = "string"))]
22969 pub param_id: CharArray<16>,
22970 #[doc = "Parameter value (new value if PARAM_ACK_ACCEPTED, current value otherwise)"]
22971 #[cfg_attr(feature = "ts", ts(type = "string"))]
22972 pub param_value: CharArray<128>,
22973 #[doc = "Parameter type."]
22974 pub param_type: MavParamExtType,
22975 #[doc = "Result code."]
22976 pub param_result: ParamAck,
22977}
22978impl PARAM_EXT_ACK_DATA {
22979 pub const ENCODED_LEN: usize = 146usize;
22980 pub const DEFAULT: Self = Self {
22981 param_id: CharArray::new([0_u8; 16usize]),
22982 param_value: CharArray::new([0_u8; 128usize]),
22983 param_type: MavParamExtType::DEFAULT,
22984 param_result: ParamAck::DEFAULT,
22985 };
22986 #[cfg(feature = "arbitrary")]
22987 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
22988 use arbitrary::{Arbitrary, Unstructured};
22989 let mut buf = [0u8; 1024];
22990 rng.fill_bytes(&mut buf);
22991 let mut unstructured = Unstructured::new(&buf);
22992 Self::arbitrary(&mut unstructured).unwrap_or_default()
22993 }
22994}
22995impl Default for PARAM_EXT_ACK_DATA {
22996 fn default() -> Self {
22997 Self::DEFAULT.clone()
22998 }
22999}
23000impl MessageData for PARAM_EXT_ACK_DATA {
23001 type Message = MavMessage;
23002 const ID: u32 = 324u32;
23003 const NAME: &'static str = "PARAM_EXT_ACK";
23004 const EXTRA_CRC: u8 = 132u8;
23005 const ENCODED_LEN: usize = 146usize;
23006 fn deser(
23007 _version: MavlinkVersion,
23008 __input: &[u8],
23009 ) -> Result<Self, ::mavlink_core::error::ParserError> {
23010 let avail_len = __input.len();
23011 let mut payload_buf = [0; Self::ENCODED_LEN];
23012 let mut buf = if avail_len < Self::ENCODED_LEN {
23013 payload_buf[0..avail_len].copy_from_slice(__input);
23014 Bytes::new(&payload_buf)
23015 } else {
23016 Bytes::new(__input)
23017 };
23018 let mut __struct = Self::default();
23019 let mut tmp = [0_u8; 16usize];
23020 for v in &mut tmp {
23021 *v = buf.get_u8();
23022 }
23023 __struct.param_id = CharArray::new(tmp);
23024 let mut tmp = [0_u8; 128usize];
23025 for v in &mut tmp {
23026 *v = buf.get_u8();
23027 }
23028 __struct.param_value = CharArray::new(tmp);
23029 let tmp = buf.get_u8();
23030 __struct.param_type =
23031 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
23032 enum_type: "MavParamExtType",
23033 value: tmp as u64,
23034 })?;
23035 let tmp = buf.get_u8();
23036 __struct.param_result =
23037 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
23038 enum_type: "ParamAck",
23039 value: tmp as u64,
23040 })?;
23041 Ok(__struct)
23042 }
23043 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
23044 let mut __tmp = BytesMut::new(bytes);
23045 #[allow(clippy::absurd_extreme_comparisons)]
23046 #[allow(unused_comparisons)]
23047 if __tmp.remaining() < Self::ENCODED_LEN {
23048 panic!(
23049 "buffer is too small (need {} bytes, but got {})",
23050 Self::ENCODED_LEN,
23051 __tmp.remaining(),
23052 )
23053 }
23054 for val in &self.param_id {
23055 __tmp.put_u8(*val);
23056 }
23057 for val in &self.param_value {
23058 __tmp.put_u8(*val);
23059 }
23060 __tmp.put_u8(self.param_type as u8);
23061 __tmp.put_u8(self.param_result as u8);
23062 if matches!(version, MavlinkVersion::V2) {
23063 let len = __tmp.len();
23064 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
23065 } else {
23066 __tmp.len()
23067 }
23068 }
23069}
23070#[doc = "Request all parameters of this component. All parameters should be emitted in response as PARAM_EXT_VALUE."]
23071#[doc = ""]
23072#[doc = "ID: 321"]
23073#[derive(Debug, Clone, PartialEq)]
23074#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
23075#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
23076#[cfg_attr(feature = "ts", derive(TS))]
23077#[cfg_attr(feature = "ts", ts(export))]
23078pub struct PARAM_EXT_REQUEST_LIST_DATA {
23079 #[doc = "System ID"]
23080 pub target_system: u8,
23081 #[doc = "Component ID"]
23082 pub target_component: u8,
23083}
23084impl PARAM_EXT_REQUEST_LIST_DATA {
23085 pub const ENCODED_LEN: usize = 2usize;
23086 pub const DEFAULT: Self = Self {
23087 target_system: 0_u8,
23088 target_component: 0_u8,
23089 };
23090 #[cfg(feature = "arbitrary")]
23091 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
23092 use arbitrary::{Arbitrary, Unstructured};
23093 let mut buf = [0u8; 1024];
23094 rng.fill_bytes(&mut buf);
23095 let mut unstructured = Unstructured::new(&buf);
23096 Self::arbitrary(&mut unstructured).unwrap_or_default()
23097 }
23098}
23099impl Default for PARAM_EXT_REQUEST_LIST_DATA {
23100 fn default() -> Self {
23101 Self::DEFAULT.clone()
23102 }
23103}
23104impl MessageData for PARAM_EXT_REQUEST_LIST_DATA {
23105 type Message = MavMessage;
23106 const ID: u32 = 321u32;
23107 const NAME: &'static str = "PARAM_EXT_REQUEST_LIST";
23108 const EXTRA_CRC: u8 = 88u8;
23109 const ENCODED_LEN: usize = 2usize;
23110 fn deser(
23111 _version: MavlinkVersion,
23112 __input: &[u8],
23113 ) -> Result<Self, ::mavlink_core::error::ParserError> {
23114 let avail_len = __input.len();
23115 let mut payload_buf = [0; Self::ENCODED_LEN];
23116 let mut buf = if avail_len < Self::ENCODED_LEN {
23117 payload_buf[0..avail_len].copy_from_slice(__input);
23118 Bytes::new(&payload_buf)
23119 } else {
23120 Bytes::new(__input)
23121 };
23122 let mut __struct = Self::default();
23123 __struct.target_system = buf.get_u8();
23124 __struct.target_component = buf.get_u8();
23125 Ok(__struct)
23126 }
23127 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
23128 let mut __tmp = BytesMut::new(bytes);
23129 #[allow(clippy::absurd_extreme_comparisons)]
23130 #[allow(unused_comparisons)]
23131 if __tmp.remaining() < Self::ENCODED_LEN {
23132 panic!(
23133 "buffer is too small (need {} bytes, but got {})",
23134 Self::ENCODED_LEN,
23135 __tmp.remaining(),
23136 )
23137 }
23138 __tmp.put_u8(self.target_system);
23139 __tmp.put_u8(self.target_component);
23140 if matches!(version, MavlinkVersion::V2) {
23141 let len = __tmp.len();
23142 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
23143 } else {
23144 __tmp.len()
23145 }
23146 }
23147}
23148#[doc = "Request to read the value of a parameter with either the param_id string id or param_index. PARAM_EXT_VALUE should be emitted in response."]
23149#[doc = ""]
23150#[doc = "ID: 320"]
23151#[derive(Debug, Clone, PartialEq)]
23152#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
23153#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
23154#[cfg_attr(feature = "ts", derive(TS))]
23155#[cfg_attr(feature = "ts", ts(export))]
23156pub struct PARAM_EXT_REQUEST_READ_DATA {
23157 #[doc = "Parameter index. Set to -1 to use the Parameter ID field as identifier (else param_id will be ignored)"]
23158 pub param_index: i16,
23159 #[doc = "System ID"]
23160 pub target_system: u8,
23161 #[doc = "Component ID"]
23162 pub target_component: u8,
23163 #[doc = "Parameter id, terminated by NULL if the length is less than 16 human-readable chars and WITHOUT null termination (NULL) byte if the length is exactly 16 chars - applications have to provide 16+1 bytes storage if the ID is stored as string"]
23164 #[cfg_attr(feature = "ts", ts(type = "string"))]
23165 pub param_id: CharArray<16>,
23166}
23167impl PARAM_EXT_REQUEST_READ_DATA {
23168 pub const ENCODED_LEN: usize = 20usize;
23169 pub const DEFAULT: Self = Self {
23170 param_index: 0_i16,
23171 target_system: 0_u8,
23172 target_component: 0_u8,
23173 param_id: CharArray::new([0_u8; 16usize]),
23174 };
23175 #[cfg(feature = "arbitrary")]
23176 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
23177 use arbitrary::{Arbitrary, Unstructured};
23178 let mut buf = [0u8; 1024];
23179 rng.fill_bytes(&mut buf);
23180 let mut unstructured = Unstructured::new(&buf);
23181 Self::arbitrary(&mut unstructured).unwrap_or_default()
23182 }
23183}
23184impl Default for PARAM_EXT_REQUEST_READ_DATA {
23185 fn default() -> Self {
23186 Self::DEFAULT.clone()
23187 }
23188}
23189impl MessageData for PARAM_EXT_REQUEST_READ_DATA {
23190 type Message = MavMessage;
23191 const ID: u32 = 320u32;
23192 const NAME: &'static str = "PARAM_EXT_REQUEST_READ";
23193 const EXTRA_CRC: u8 = 243u8;
23194 const ENCODED_LEN: usize = 20usize;
23195 fn deser(
23196 _version: MavlinkVersion,
23197 __input: &[u8],
23198 ) -> Result<Self, ::mavlink_core::error::ParserError> {
23199 let avail_len = __input.len();
23200 let mut payload_buf = [0; Self::ENCODED_LEN];
23201 let mut buf = if avail_len < Self::ENCODED_LEN {
23202 payload_buf[0..avail_len].copy_from_slice(__input);
23203 Bytes::new(&payload_buf)
23204 } else {
23205 Bytes::new(__input)
23206 };
23207 let mut __struct = Self::default();
23208 __struct.param_index = buf.get_i16_le();
23209 __struct.target_system = buf.get_u8();
23210 __struct.target_component = buf.get_u8();
23211 let mut tmp = [0_u8; 16usize];
23212 for v in &mut tmp {
23213 *v = buf.get_u8();
23214 }
23215 __struct.param_id = CharArray::new(tmp);
23216 Ok(__struct)
23217 }
23218 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
23219 let mut __tmp = BytesMut::new(bytes);
23220 #[allow(clippy::absurd_extreme_comparisons)]
23221 #[allow(unused_comparisons)]
23222 if __tmp.remaining() < Self::ENCODED_LEN {
23223 panic!(
23224 "buffer is too small (need {} bytes, but got {})",
23225 Self::ENCODED_LEN,
23226 __tmp.remaining(),
23227 )
23228 }
23229 __tmp.put_i16_le(self.param_index);
23230 __tmp.put_u8(self.target_system);
23231 __tmp.put_u8(self.target_component);
23232 for val in &self.param_id {
23233 __tmp.put_u8(*val);
23234 }
23235 if matches!(version, MavlinkVersion::V2) {
23236 let len = __tmp.len();
23237 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
23238 } else {
23239 __tmp.len()
23240 }
23241 }
23242}
23243#[doc = "Set a parameter value. In order to deal with message loss (and retransmission of PARAM_EXT_SET), when setting a parameter value and the new value is the same as the current value, you will immediately get a PARAM_ACK_ACCEPTED response. If the current state is PARAM_ACK_IN_PROGRESS, you will accordingly receive a PARAM_ACK_IN_PROGRESS in response."]
23244#[doc = ""]
23245#[doc = "ID: 323"]
23246#[derive(Debug, Clone, PartialEq)]
23247#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
23248#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
23249#[cfg_attr(feature = "ts", derive(TS))]
23250#[cfg_attr(feature = "ts", ts(export))]
23251pub struct PARAM_EXT_SET_DATA {
23252 #[doc = "System ID"]
23253 pub target_system: u8,
23254 #[doc = "Component ID"]
23255 pub target_component: u8,
23256 #[doc = "Parameter id, terminated by NULL if the length is less than 16 human-readable chars and WITHOUT null termination (NULL) byte if the length is exactly 16 chars - applications have to provide 16+1 bytes storage if the ID is stored as string"]
23257 #[cfg_attr(feature = "ts", ts(type = "string"))]
23258 pub param_id: CharArray<16>,
23259 #[doc = "Parameter value"]
23260 #[cfg_attr(feature = "ts", ts(type = "string"))]
23261 pub param_value: CharArray<128>,
23262 #[doc = "Parameter type."]
23263 pub param_type: MavParamExtType,
23264}
23265impl PARAM_EXT_SET_DATA {
23266 pub const ENCODED_LEN: usize = 147usize;
23267 pub const DEFAULT: Self = Self {
23268 target_system: 0_u8,
23269 target_component: 0_u8,
23270 param_id: CharArray::new([0_u8; 16usize]),
23271 param_value: CharArray::new([0_u8; 128usize]),
23272 param_type: MavParamExtType::DEFAULT,
23273 };
23274 #[cfg(feature = "arbitrary")]
23275 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
23276 use arbitrary::{Arbitrary, Unstructured};
23277 let mut buf = [0u8; 1024];
23278 rng.fill_bytes(&mut buf);
23279 let mut unstructured = Unstructured::new(&buf);
23280 Self::arbitrary(&mut unstructured).unwrap_or_default()
23281 }
23282}
23283impl Default for PARAM_EXT_SET_DATA {
23284 fn default() -> Self {
23285 Self::DEFAULT.clone()
23286 }
23287}
23288impl MessageData for PARAM_EXT_SET_DATA {
23289 type Message = MavMessage;
23290 const ID: u32 = 323u32;
23291 const NAME: &'static str = "PARAM_EXT_SET";
23292 const EXTRA_CRC: u8 = 78u8;
23293 const ENCODED_LEN: usize = 147usize;
23294 fn deser(
23295 _version: MavlinkVersion,
23296 __input: &[u8],
23297 ) -> Result<Self, ::mavlink_core::error::ParserError> {
23298 let avail_len = __input.len();
23299 let mut payload_buf = [0; Self::ENCODED_LEN];
23300 let mut buf = if avail_len < Self::ENCODED_LEN {
23301 payload_buf[0..avail_len].copy_from_slice(__input);
23302 Bytes::new(&payload_buf)
23303 } else {
23304 Bytes::new(__input)
23305 };
23306 let mut __struct = Self::default();
23307 __struct.target_system = buf.get_u8();
23308 __struct.target_component = buf.get_u8();
23309 let mut tmp = [0_u8; 16usize];
23310 for v in &mut tmp {
23311 *v = buf.get_u8();
23312 }
23313 __struct.param_id = CharArray::new(tmp);
23314 let mut tmp = [0_u8; 128usize];
23315 for v in &mut tmp {
23316 *v = buf.get_u8();
23317 }
23318 __struct.param_value = CharArray::new(tmp);
23319 let tmp = buf.get_u8();
23320 __struct.param_type =
23321 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
23322 enum_type: "MavParamExtType",
23323 value: tmp as u64,
23324 })?;
23325 Ok(__struct)
23326 }
23327 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
23328 let mut __tmp = BytesMut::new(bytes);
23329 #[allow(clippy::absurd_extreme_comparisons)]
23330 #[allow(unused_comparisons)]
23331 if __tmp.remaining() < Self::ENCODED_LEN {
23332 panic!(
23333 "buffer is too small (need {} bytes, but got {})",
23334 Self::ENCODED_LEN,
23335 __tmp.remaining(),
23336 )
23337 }
23338 __tmp.put_u8(self.target_system);
23339 __tmp.put_u8(self.target_component);
23340 for val in &self.param_id {
23341 __tmp.put_u8(*val);
23342 }
23343 for val in &self.param_value {
23344 __tmp.put_u8(*val);
23345 }
23346 __tmp.put_u8(self.param_type as u8);
23347 if matches!(version, MavlinkVersion::V2) {
23348 let len = __tmp.len();
23349 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
23350 } else {
23351 __tmp.len()
23352 }
23353 }
23354}
23355#[doc = "Emit the value of a parameter. The inclusion of param_count and param_index in the message allows the recipient to keep track of received parameters and allows them to re-request missing parameters after a loss or timeout."]
23356#[doc = ""]
23357#[doc = "ID: 322"]
23358#[derive(Debug, Clone, PartialEq)]
23359#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
23360#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
23361#[cfg_attr(feature = "ts", derive(TS))]
23362#[cfg_attr(feature = "ts", ts(export))]
23363pub struct PARAM_EXT_VALUE_DATA {
23364 #[doc = "Total number of parameters"]
23365 pub param_count: u16,
23366 #[doc = "Index of this parameter"]
23367 pub param_index: u16,
23368 #[doc = "Parameter id, terminated by NULL if the length is less than 16 human-readable chars and WITHOUT null termination (NULL) byte if the length is exactly 16 chars - applications have to provide 16+1 bytes storage if the ID is stored as string"]
23369 #[cfg_attr(feature = "ts", ts(type = "string"))]
23370 pub param_id: CharArray<16>,
23371 #[doc = "Parameter value"]
23372 #[cfg_attr(feature = "ts", ts(type = "string"))]
23373 pub param_value: CharArray<128>,
23374 #[doc = "Parameter type."]
23375 pub param_type: MavParamExtType,
23376}
23377impl PARAM_EXT_VALUE_DATA {
23378 pub const ENCODED_LEN: usize = 149usize;
23379 pub const DEFAULT: Self = Self {
23380 param_count: 0_u16,
23381 param_index: 0_u16,
23382 param_id: CharArray::new([0_u8; 16usize]),
23383 param_value: CharArray::new([0_u8; 128usize]),
23384 param_type: MavParamExtType::DEFAULT,
23385 };
23386 #[cfg(feature = "arbitrary")]
23387 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
23388 use arbitrary::{Arbitrary, Unstructured};
23389 let mut buf = [0u8; 1024];
23390 rng.fill_bytes(&mut buf);
23391 let mut unstructured = Unstructured::new(&buf);
23392 Self::arbitrary(&mut unstructured).unwrap_or_default()
23393 }
23394}
23395impl Default for PARAM_EXT_VALUE_DATA {
23396 fn default() -> Self {
23397 Self::DEFAULT.clone()
23398 }
23399}
23400impl MessageData for PARAM_EXT_VALUE_DATA {
23401 type Message = MavMessage;
23402 const ID: u32 = 322u32;
23403 const NAME: &'static str = "PARAM_EXT_VALUE";
23404 const EXTRA_CRC: u8 = 243u8;
23405 const ENCODED_LEN: usize = 149usize;
23406 fn deser(
23407 _version: MavlinkVersion,
23408 __input: &[u8],
23409 ) -> Result<Self, ::mavlink_core::error::ParserError> {
23410 let avail_len = __input.len();
23411 let mut payload_buf = [0; Self::ENCODED_LEN];
23412 let mut buf = if avail_len < Self::ENCODED_LEN {
23413 payload_buf[0..avail_len].copy_from_slice(__input);
23414 Bytes::new(&payload_buf)
23415 } else {
23416 Bytes::new(__input)
23417 };
23418 let mut __struct = Self::default();
23419 __struct.param_count = buf.get_u16_le();
23420 __struct.param_index = buf.get_u16_le();
23421 let mut tmp = [0_u8; 16usize];
23422 for v in &mut tmp {
23423 *v = buf.get_u8();
23424 }
23425 __struct.param_id = CharArray::new(tmp);
23426 let mut tmp = [0_u8; 128usize];
23427 for v in &mut tmp {
23428 *v = buf.get_u8();
23429 }
23430 __struct.param_value = CharArray::new(tmp);
23431 let tmp = buf.get_u8();
23432 __struct.param_type =
23433 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
23434 enum_type: "MavParamExtType",
23435 value: tmp as u64,
23436 })?;
23437 Ok(__struct)
23438 }
23439 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
23440 let mut __tmp = BytesMut::new(bytes);
23441 #[allow(clippy::absurd_extreme_comparisons)]
23442 #[allow(unused_comparisons)]
23443 if __tmp.remaining() < Self::ENCODED_LEN {
23444 panic!(
23445 "buffer is too small (need {} bytes, but got {})",
23446 Self::ENCODED_LEN,
23447 __tmp.remaining(),
23448 )
23449 }
23450 __tmp.put_u16_le(self.param_count);
23451 __tmp.put_u16_le(self.param_index);
23452 for val in &self.param_id {
23453 __tmp.put_u8(*val);
23454 }
23455 for val in &self.param_value {
23456 __tmp.put_u8(*val);
23457 }
23458 __tmp.put_u8(self.param_type as u8);
23459 if matches!(version, MavlinkVersion::V2) {
23460 let len = __tmp.len();
23461 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
23462 } else {
23463 __tmp.len()
23464 }
23465 }
23466}
23467#[doc = "Bind a RC channel to a parameter. The parameter should change according to the RC channel value."]
23468#[doc = ""]
23469#[doc = "ID: 50"]
23470#[derive(Debug, Clone, PartialEq)]
23471#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
23472#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
23473#[cfg_attr(feature = "ts", derive(TS))]
23474#[cfg_attr(feature = "ts", ts(export))]
23475pub struct PARAM_MAP_RC_DATA {
23476 #[doc = "Initial parameter value"]
23477 pub param_value0: f32,
23478 #[doc = "Scale, maps the RC range [-1, 1] to a parameter value"]
23479 pub scale: f32,
23480 #[doc = "Minimum param value. The protocol does not define if this overwrites an onboard minimum value. (Depends on implementation)"]
23481 pub param_value_min: f32,
23482 #[doc = "Maximum param value. The protocol does not define if this overwrites an onboard maximum value. (Depends on implementation)"]
23483 pub param_value_max: f32,
23484 #[doc = "Parameter index. Send -1 to use the param ID field as identifier (else the param id will be ignored), send -2 to disable any existing map for this rc_channel_index."]
23485 pub param_index: i16,
23486 #[doc = "System ID"]
23487 pub target_system: u8,
23488 #[doc = "Component ID"]
23489 pub target_component: u8,
23490 #[doc = "Onboard parameter id, terminated by NULL if the length is less than 16 human-readable chars and WITHOUT null termination (NULL) byte if the length is exactly 16 chars - applications have to provide 16+1 bytes storage if the ID is stored as string"]
23491 #[cfg_attr(feature = "ts", ts(type = "string"))]
23492 pub param_id: CharArray<16>,
23493 #[doc = "Index of parameter RC channel. Not equal to the RC channel id. Typically corresponds to a potentiometer-knob on the RC."]
23494 pub parameter_rc_channel_index: u8,
23495}
23496impl PARAM_MAP_RC_DATA {
23497 pub const ENCODED_LEN: usize = 37usize;
23498 pub const DEFAULT: Self = Self {
23499 param_value0: 0.0_f32,
23500 scale: 0.0_f32,
23501 param_value_min: 0.0_f32,
23502 param_value_max: 0.0_f32,
23503 param_index: 0_i16,
23504 target_system: 0_u8,
23505 target_component: 0_u8,
23506 param_id: CharArray::new([0_u8; 16usize]),
23507 parameter_rc_channel_index: 0_u8,
23508 };
23509 #[cfg(feature = "arbitrary")]
23510 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
23511 use arbitrary::{Arbitrary, Unstructured};
23512 let mut buf = [0u8; 1024];
23513 rng.fill_bytes(&mut buf);
23514 let mut unstructured = Unstructured::new(&buf);
23515 Self::arbitrary(&mut unstructured).unwrap_or_default()
23516 }
23517}
23518impl Default for PARAM_MAP_RC_DATA {
23519 fn default() -> Self {
23520 Self::DEFAULT.clone()
23521 }
23522}
23523impl MessageData for PARAM_MAP_RC_DATA {
23524 type Message = MavMessage;
23525 const ID: u32 = 50u32;
23526 const NAME: &'static str = "PARAM_MAP_RC";
23527 const EXTRA_CRC: u8 = 78u8;
23528 const ENCODED_LEN: usize = 37usize;
23529 fn deser(
23530 _version: MavlinkVersion,
23531 __input: &[u8],
23532 ) -> Result<Self, ::mavlink_core::error::ParserError> {
23533 let avail_len = __input.len();
23534 let mut payload_buf = [0; Self::ENCODED_LEN];
23535 let mut buf = if avail_len < Self::ENCODED_LEN {
23536 payload_buf[0..avail_len].copy_from_slice(__input);
23537 Bytes::new(&payload_buf)
23538 } else {
23539 Bytes::new(__input)
23540 };
23541 let mut __struct = Self::default();
23542 __struct.param_value0 = buf.get_f32_le();
23543 __struct.scale = buf.get_f32_le();
23544 __struct.param_value_min = buf.get_f32_le();
23545 __struct.param_value_max = buf.get_f32_le();
23546 __struct.param_index = buf.get_i16_le();
23547 __struct.target_system = buf.get_u8();
23548 __struct.target_component = buf.get_u8();
23549 let mut tmp = [0_u8; 16usize];
23550 for v in &mut tmp {
23551 *v = buf.get_u8();
23552 }
23553 __struct.param_id = CharArray::new(tmp);
23554 __struct.parameter_rc_channel_index = buf.get_u8();
23555 Ok(__struct)
23556 }
23557 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
23558 let mut __tmp = BytesMut::new(bytes);
23559 #[allow(clippy::absurd_extreme_comparisons)]
23560 #[allow(unused_comparisons)]
23561 if __tmp.remaining() < Self::ENCODED_LEN {
23562 panic!(
23563 "buffer is too small (need {} bytes, but got {})",
23564 Self::ENCODED_LEN,
23565 __tmp.remaining(),
23566 )
23567 }
23568 __tmp.put_f32_le(self.param_value0);
23569 __tmp.put_f32_le(self.scale);
23570 __tmp.put_f32_le(self.param_value_min);
23571 __tmp.put_f32_le(self.param_value_max);
23572 __tmp.put_i16_le(self.param_index);
23573 __tmp.put_u8(self.target_system);
23574 __tmp.put_u8(self.target_component);
23575 for val in &self.param_id {
23576 __tmp.put_u8(*val);
23577 }
23578 __tmp.put_u8(self.parameter_rc_channel_index);
23579 if matches!(version, MavlinkVersion::V2) {
23580 let len = __tmp.len();
23581 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
23582 } else {
23583 __tmp.len()
23584 }
23585 }
23586}
23587#[doc = "Request all parameters of this component. After this request, all parameters are emitted. The parameter microservice is documented at <https://mavlink.io/en/services/parameter.html>."]
23588#[doc = ""]
23589#[doc = "ID: 21"]
23590#[derive(Debug, Clone, PartialEq)]
23591#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
23592#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
23593#[cfg_attr(feature = "ts", derive(TS))]
23594#[cfg_attr(feature = "ts", ts(export))]
23595pub struct PARAM_REQUEST_LIST_DATA {
23596 #[doc = "System ID"]
23597 pub target_system: u8,
23598 #[doc = "Component ID"]
23599 pub target_component: u8,
23600}
23601impl PARAM_REQUEST_LIST_DATA {
23602 pub const ENCODED_LEN: usize = 2usize;
23603 pub const DEFAULT: Self = Self {
23604 target_system: 0_u8,
23605 target_component: 0_u8,
23606 };
23607 #[cfg(feature = "arbitrary")]
23608 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
23609 use arbitrary::{Arbitrary, Unstructured};
23610 let mut buf = [0u8; 1024];
23611 rng.fill_bytes(&mut buf);
23612 let mut unstructured = Unstructured::new(&buf);
23613 Self::arbitrary(&mut unstructured).unwrap_or_default()
23614 }
23615}
23616impl Default for PARAM_REQUEST_LIST_DATA {
23617 fn default() -> Self {
23618 Self::DEFAULT.clone()
23619 }
23620}
23621impl MessageData for PARAM_REQUEST_LIST_DATA {
23622 type Message = MavMessage;
23623 const ID: u32 = 21u32;
23624 const NAME: &'static str = "PARAM_REQUEST_LIST";
23625 const EXTRA_CRC: u8 = 159u8;
23626 const ENCODED_LEN: usize = 2usize;
23627 fn deser(
23628 _version: MavlinkVersion,
23629 __input: &[u8],
23630 ) -> Result<Self, ::mavlink_core::error::ParserError> {
23631 let avail_len = __input.len();
23632 let mut payload_buf = [0; Self::ENCODED_LEN];
23633 let mut buf = if avail_len < Self::ENCODED_LEN {
23634 payload_buf[0..avail_len].copy_from_slice(__input);
23635 Bytes::new(&payload_buf)
23636 } else {
23637 Bytes::new(__input)
23638 };
23639 let mut __struct = Self::default();
23640 __struct.target_system = buf.get_u8();
23641 __struct.target_component = buf.get_u8();
23642 Ok(__struct)
23643 }
23644 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
23645 let mut __tmp = BytesMut::new(bytes);
23646 #[allow(clippy::absurd_extreme_comparisons)]
23647 #[allow(unused_comparisons)]
23648 if __tmp.remaining() < Self::ENCODED_LEN {
23649 panic!(
23650 "buffer is too small (need {} bytes, but got {})",
23651 Self::ENCODED_LEN,
23652 __tmp.remaining(),
23653 )
23654 }
23655 __tmp.put_u8(self.target_system);
23656 __tmp.put_u8(self.target_component);
23657 if matches!(version, MavlinkVersion::V2) {
23658 let len = __tmp.len();
23659 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
23660 } else {
23661 __tmp.len()
23662 }
23663 }
23664}
23665#[doc = "value[float]. This allows to send a parameter to any other component (such as the GCS) without the need of previous knowledge of possible parameter names. Thus the same GCS can store different parameters for different autopilots. See also <https://mavlink.io/en/services/parameter.html> for a full documentation of QGroundControl and IMU code."]
23666#[doc = ""]
23667#[doc = "ID: 20"]
23668#[derive(Debug, Clone, PartialEq)]
23669#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
23670#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
23671#[cfg_attr(feature = "ts", derive(TS))]
23672#[cfg_attr(feature = "ts", ts(export))]
23673pub struct PARAM_REQUEST_READ_DATA {
23674 #[doc = "Parameter index. Send -1 to use the param ID field as identifier (else the param id will be ignored)"]
23675 pub param_index: i16,
23676 #[doc = "System ID"]
23677 pub target_system: u8,
23678 #[doc = "Component ID"]
23679 pub target_component: u8,
23680 #[doc = "Onboard parameter id, terminated by NULL if the length is less than 16 human-readable chars and WITHOUT null termination (NULL) byte if the length is exactly 16 chars - applications have to provide 16+1 bytes storage if the ID is stored as string"]
23681 #[cfg_attr(feature = "ts", ts(type = "string"))]
23682 pub param_id: CharArray<16>,
23683}
23684impl PARAM_REQUEST_READ_DATA {
23685 pub const ENCODED_LEN: usize = 20usize;
23686 pub const DEFAULT: Self = Self {
23687 param_index: 0_i16,
23688 target_system: 0_u8,
23689 target_component: 0_u8,
23690 param_id: CharArray::new([0_u8; 16usize]),
23691 };
23692 #[cfg(feature = "arbitrary")]
23693 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
23694 use arbitrary::{Arbitrary, Unstructured};
23695 let mut buf = [0u8; 1024];
23696 rng.fill_bytes(&mut buf);
23697 let mut unstructured = Unstructured::new(&buf);
23698 Self::arbitrary(&mut unstructured).unwrap_or_default()
23699 }
23700}
23701impl Default for PARAM_REQUEST_READ_DATA {
23702 fn default() -> Self {
23703 Self::DEFAULT.clone()
23704 }
23705}
23706impl MessageData for PARAM_REQUEST_READ_DATA {
23707 type Message = MavMessage;
23708 const ID: u32 = 20u32;
23709 const NAME: &'static str = "PARAM_REQUEST_READ";
23710 const EXTRA_CRC: u8 = 214u8;
23711 const ENCODED_LEN: usize = 20usize;
23712 fn deser(
23713 _version: MavlinkVersion,
23714 __input: &[u8],
23715 ) -> Result<Self, ::mavlink_core::error::ParserError> {
23716 let avail_len = __input.len();
23717 let mut payload_buf = [0; Self::ENCODED_LEN];
23718 let mut buf = if avail_len < Self::ENCODED_LEN {
23719 payload_buf[0..avail_len].copy_from_slice(__input);
23720 Bytes::new(&payload_buf)
23721 } else {
23722 Bytes::new(__input)
23723 };
23724 let mut __struct = Self::default();
23725 __struct.param_index = buf.get_i16_le();
23726 __struct.target_system = buf.get_u8();
23727 __struct.target_component = buf.get_u8();
23728 let mut tmp = [0_u8; 16usize];
23729 for v in &mut tmp {
23730 *v = buf.get_u8();
23731 }
23732 __struct.param_id = CharArray::new(tmp);
23733 Ok(__struct)
23734 }
23735 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
23736 let mut __tmp = BytesMut::new(bytes);
23737 #[allow(clippy::absurd_extreme_comparisons)]
23738 #[allow(unused_comparisons)]
23739 if __tmp.remaining() < Self::ENCODED_LEN {
23740 panic!(
23741 "buffer is too small (need {} bytes, but got {})",
23742 Self::ENCODED_LEN,
23743 __tmp.remaining(),
23744 )
23745 }
23746 __tmp.put_i16_le(self.param_index);
23747 __tmp.put_u8(self.target_system);
23748 __tmp.put_u8(self.target_component);
23749 for val in &self.param_id {
23750 __tmp.put_u8(*val);
23751 }
23752 if matches!(version, MavlinkVersion::V2) {
23753 let len = __tmp.len();
23754 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
23755 } else {
23756 __tmp.len()
23757 }
23758 }
23759}
23760#[doc = "Set a parameter value (write new value to permanent storage). The receiving component should acknowledge the new parameter value by broadcasting a PARAM_VALUE message (broadcasting ensures that multiple GCS all have an up-to-date list of all parameters). If the sending GCS did not receive a PARAM_VALUE within its timeout time, it should re-send the PARAM_SET message. The parameter microservice is documented at <https://mavlink.io/en/services/parameter.html>."]
23761#[doc = ""]
23762#[doc = "ID: 23"]
23763#[derive(Debug, Clone, PartialEq)]
23764#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
23765#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
23766#[cfg_attr(feature = "ts", derive(TS))]
23767#[cfg_attr(feature = "ts", ts(export))]
23768pub struct PARAM_SET_DATA {
23769 #[doc = "Onboard parameter value"]
23770 pub param_value: f32,
23771 #[doc = "System ID"]
23772 pub target_system: u8,
23773 #[doc = "Component ID"]
23774 pub target_component: u8,
23775 #[doc = "Onboard parameter id, terminated by NULL if the length is less than 16 human-readable chars and WITHOUT null termination (NULL) byte if the length is exactly 16 chars - applications have to provide 16+1 bytes storage if the ID is stored as string"]
23776 #[cfg_attr(feature = "ts", ts(type = "string"))]
23777 pub param_id: CharArray<16>,
23778 #[doc = "Onboard parameter type."]
23779 pub param_type: MavParamType,
23780}
23781impl PARAM_SET_DATA {
23782 pub const ENCODED_LEN: usize = 23usize;
23783 pub const DEFAULT: Self = Self {
23784 param_value: 0.0_f32,
23785 target_system: 0_u8,
23786 target_component: 0_u8,
23787 param_id: CharArray::new([0_u8; 16usize]),
23788 param_type: MavParamType::DEFAULT,
23789 };
23790 #[cfg(feature = "arbitrary")]
23791 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
23792 use arbitrary::{Arbitrary, Unstructured};
23793 let mut buf = [0u8; 1024];
23794 rng.fill_bytes(&mut buf);
23795 let mut unstructured = Unstructured::new(&buf);
23796 Self::arbitrary(&mut unstructured).unwrap_or_default()
23797 }
23798}
23799impl Default for PARAM_SET_DATA {
23800 fn default() -> Self {
23801 Self::DEFAULT.clone()
23802 }
23803}
23804impl MessageData for PARAM_SET_DATA {
23805 type Message = MavMessage;
23806 const ID: u32 = 23u32;
23807 const NAME: &'static str = "PARAM_SET";
23808 const EXTRA_CRC: u8 = 168u8;
23809 const ENCODED_LEN: usize = 23usize;
23810 fn deser(
23811 _version: MavlinkVersion,
23812 __input: &[u8],
23813 ) -> Result<Self, ::mavlink_core::error::ParserError> {
23814 let avail_len = __input.len();
23815 let mut payload_buf = [0; Self::ENCODED_LEN];
23816 let mut buf = if avail_len < Self::ENCODED_LEN {
23817 payload_buf[0..avail_len].copy_from_slice(__input);
23818 Bytes::new(&payload_buf)
23819 } else {
23820 Bytes::new(__input)
23821 };
23822 let mut __struct = Self::default();
23823 __struct.param_value = buf.get_f32_le();
23824 __struct.target_system = buf.get_u8();
23825 __struct.target_component = buf.get_u8();
23826 let mut tmp = [0_u8; 16usize];
23827 for v in &mut tmp {
23828 *v = buf.get_u8();
23829 }
23830 __struct.param_id = CharArray::new(tmp);
23831 let tmp = buf.get_u8();
23832 __struct.param_type =
23833 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
23834 enum_type: "MavParamType",
23835 value: tmp as u64,
23836 })?;
23837 Ok(__struct)
23838 }
23839 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
23840 let mut __tmp = BytesMut::new(bytes);
23841 #[allow(clippy::absurd_extreme_comparisons)]
23842 #[allow(unused_comparisons)]
23843 if __tmp.remaining() < Self::ENCODED_LEN {
23844 panic!(
23845 "buffer is too small (need {} bytes, but got {})",
23846 Self::ENCODED_LEN,
23847 __tmp.remaining(),
23848 )
23849 }
23850 __tmp.put_f32_le(self.param_value);
23851 __tmp.put_u8(self.target_system);
23852 __tmp.put_u8(self.target_component);
23853 for val in &self.param_id {
23854 __tmp.put_u8(*val);
23855 }
23856 __tmp.put_u8(self.param_type as u8);
23857 if matches!(version, MavlinkVersion::V2) {
23858 let len = __tmp.len();
23859 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
23860 } else {
23861 __tmp.len()
23862 }
23863 }
23864}
23865#[doc = "Emit the value of a onboard parameter. The inclusion of param_count and param_index in the message allows the recipient to keep track of received parameters and allows him to re-request missing parameters after a loss or timeout. The parameter microservice is documented at <https://mavlink.io/en/services/parameter.html>."]
23866#[doc = ""]
23867#[doc = "ID: 22"]
23868#[derive(Debug, Clone, PartialEq)]
23869#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
23870#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
23871#[cfg_attr(feature = "ts", derive(TS))]
23872#[cfg_attr(feature = "ts", ts(export))]
23873pub struct PARAM_VALUE_DATA {
23874 #[doc = "Onboard parameter value"]
23875 pub param_value: f32,
23876 #[doc = "Total number of onboard parameters"]
23877 pub param_count: u16,
23878 #[doc = "Index of this onboard parameter"]
23879 pub param_index: u16,
23880 #[doc = "Onboard parameter id, terminated by NULL if the length is less than 16 human-readable chars and WITHOUT null termination (NULL) byte if the length is exactly 16 chars - applications have to provide 16+1 bytes storage if the ID is stored as string"]
23881 #[cfg_attr(feature = "ts", ts(type = "string"))]
23882 pub param_id: CharArray<16>,
23883 #[doc = "Onboard parameter type."]
23884 pub param_type: MavParamType,
23885}
23886impl PARAM_VALUE_DATA {
23887 pub const ENCODED_LEN: usize = 25usize;
23888 pub const DEFAULT: Self = Self {
23889 param_value: 0.0_f32,
23890 param_count: 0_u16,
23891 param_index: 0_u16,
23892 param_id: CharArray::new([0_u8; 16usize]),
23893 param_type: MavParamType::DEFAULT,
23894 };
23895 #[cfg(feature = "arbitrary")]
23896 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
23897 use arbitrary::{Arbitrary, Unstructured};
23898 let mut buf = [0u8; 1024];
23899 rng.fill_bytes(&mut buf);
23900 let mut unstructured = Unstructured::new(&buf);
23901 Self::arbitrary(&mut unstructured).unwrap_or_default()
23902 }
23903}
23904impl Default for PARAM_VALUE_DATA {
23905 fn default() -> Self {
23906 Self::DEFAULT.clone()
23907 }
23908}
23909impl MessageData for PARAM_VALUE_DATA {
23910 type Message = MavMessage;
23911 const ID: u32 = 22u32;
23912 const NAME: &'static str = "PARAM_VALUE";
23913 const EXTRA_CRC: u8 = 220u8;
23914 const ENCODED_LEN: usize = 25usize;
23915 fn deser(
23916 _version: MavlinkVersion,
23917 __input: &[u8],
23918 ) -> Result<Self, ::mavlink_core::error::ParserError> {
23919 let avail_len = __input.len();
23920 let mut payload_buf = [0; Self::ENCODED_LEN];
23921 let mut buf = if avail_len < Self::ENCODED_LEN {
23922 payload_buf[0..avail_len].copy_from_slice(__input);
23923 Bytes::new(&payload_buf)
23924 } else {
23925 Bytes::new(__input)
23926 };
23927 let mut __struct = Self::default();
23928 __struct.param_value = buf.get_f32_le();
23929 __struct.param_count = buf.get_u16_le();
23930 __struct.param_index = buf.get_u16_le();
23931 let mut tmp = [0_u8; 16usize];
23932 for v in &mut tmp {
23933 *v = buf.get_u8();
23934 }
23935 __struct.param_id = CharArray::new(tmp);
23936 let tmp = buf.get_u8();
23937 __struct.param_type =
23938 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
23939 enum_type: "MavParamType",
23940 value: tmp as u64,
23941 })?;
23942 Ok(__struct)
23943 }
23944 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
23945 let mut __tmp = BytesMut::new(bytes);
23946 #[allow(clippy::absurd_extreme_comparisons)]
23947 #[allow(unused_comparisons)]
23948 if __tmp.remaining() < Self::ENCODED_LEN {
23949 panic!(
23950 "buffer is too small (need {} bytes, but got {})",
23951 Self::ENCODED_LEN,
23952 __tmp.remaining(),
23953 )
23954 }
23955 __tmp.put_f32_le(self.param_value);
23956 __tmp.put_u16_le(self.param_count);
23957 __tmp.put_u16_le(self.param_index);
23958 for val in &self.param_id {
23959 __tmp.put_u8(*val);
23960 }
23961 __tmp.put_u8(self.param_type as u8);
23962 if matches!(version, MavlinkVersion::V2) {
23963 let len = __tmp.len();
23964 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
23965 } else {
23966 __tmp.len()
23967 }
23968 }
23969}
23970#[deprecated = "To be removed / merged with TIMESYNC. See `TIMESYNC` (Deprecated since 2011-08)"]
23971#[doc = "A ping message either requesting or responding to a ping. This allows to measure the system latencies, including serial port, radio modem and UDP connections. The ping microservice is documented at <https://mavlink.io/en/services/ping.html>."]
23972#[doc = ""]
23973#[doc = "ID: 4"]
23974#[derive(Debug, Clone, PartialEq)]
23975#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
23976#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
23977#[cfg_attr(feature = "ts", derive(TS))]
23978#[cfg_attr(feature = "ts", ts(export))]
23979pub struct PING_DATA {
23980 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
23981 pub time_usec: u64,
23982 #[doc = "PING sequence"]
23983 pub seq: u32,
23984 #[doc = "0: request ping from all receiving systems. If greater than 0: message is a ping response and number is the system id of the requesting system"]
23985 pub target_system: u8,
23986 #[doc = "0: request ping from all receiving components. If greater than 0: message is a ping response and number is the component id of the requesting component."]
23987 pub target_component: u8,
23988}
23989impl PING_DATA {
23990 pub const ENCODED_LEN: usize = 14usize;
23991 pub const DEFAULT: Self = Self {
23992 time_usec: 0_u64,
23993 seq: 0_u32,
23994 target_system: 0_u8,
23995 target_component: 0_u8,
23996 };
23997 #[cfg(feature = "arbitrary")]
23998 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
23999 use arbitrary::{Arbitrary, Unstructured};
24000 let mut buf = [0u8; 1024];
24001 rng.fill_bytes(&mut buf);
24002 let mut unstructured = Unstructured::new(&buf);
24003 Self::arbitrary(&mut unstructured).unwrap_or_default()
24004 }
24005}
24006impl Default for PING_DATA {
24007 fn default() -> Self {
24008 Self::DEFAULT.clone()
24009 }
24010}
24011impl MessageData for PING_DATA {
24012 type Message = MavMessage;
24013 const ID: u32 = 4u32;
24014 const NAME: &'static str = "PING";
24015 const EXTRA_CRC: u8 = 237u8;
24016 const ENCODED_LEN: usize = 14usize;
24017 fn deser(
24018 _version: MavlinkVersion,
24019 __input: &[u8],
24020 ) -> Result<Self, ::mavlink_core::error::ParserError> {
24021 let avail_len = __input.len();
24022 let mut payload_buf = [0; Self::ENCODED_LEN];
24023 let mut buf = if avail_len < Self::ENCODED_LEN {
24024 payload_buf[0..avail_len].copy_from_slice(__input);
24025 Bytes::new(&payload_buf)
24026 } else {
24027 Bytes::new(__input)
24028 };
24029 let mut __struct = Self::default();
24030 __struct.time_usec = buf.get_u64_le();
24031 __struct.seq = buf.get_u32_le();
24032 __struct.target_system = buf.get_u8();
24033 __struct.target_component = buf.get_u8();
24034 Ok(__struct)
24035 }
24036 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
24037 let mut __tmp = BytesMut::new(bytes);
24038 #[allow(clippy::absurd_extreme_comparisons)]
24039 #[allow(unused_comparisons)]
24040 if __tmp.remaining() < Self::ENCODED_LEN {
24041 panic!(
24042 "buffer is too small (need {} bytes, but got {})",
24043 Self::ENCODED_LEN,
24044 __tmp.remaining(),
24045 )
24046 }
24047 __tmp.put_u64_le(self.time_usec);
24048 __tmp.put_u32_le(self.seq);
24049 __tmp.put_u8(self.target_system);
24050 __tmp.put_u8(self.target_component);
24051 if matches!(version, MavlinkVersion::V2) {
24052 let len = __tmp.len();
24053 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
24054 } else {
24055 __tmp.len()
24056 }
24057 }
24058}
24059#[deprecated = "New version explicitly defines format. More interoperable. See `PLAY_TUNE_V2` (Deprecated since 2019-10)"]
24060#[doc = "Control vehicle tone generation (buzzer)."]
24061#[doc = ""]
24062#[doc = "ID: 258"]
24063#[derive(Debug, Clone, PartialEq)]
24064#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
24065#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
24066#[cfg_attr(feature = "ts", derive(TS))]
24067#[cfg_attr(feature = "ts", ts(export))]
24068pub struct PLAY_TUNE_DATA {
24069 #[doc = "System ID"]
24070 pub target_system: u8,
24071 #[doc = "Component ID"]
24072 pub target_component: u8,
24073 #[doc = "tune in board specific format"]
24074 #[cfg_attr(feature = "ts", ts(type = "string"))]
24075 pub tune: CharArray<30>,
24076 #[doc = "tune extension (appended to tune)"]
24077 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
24078 #[cfg_attr(feature = "ts", ts(type = "string"))]
24079 pub tune2: CharArray<200>,
24080}
24081impl PLAY_TUNE_DATA {
24082 pub const ENCODED_LEN: usize = 232usize;
24083 pub const DEFAULT: Self = Self {
24084 target_system: 0_u8,
24085 target_component: 0_u8,
24086 tune: CharArray::new([0_u8; 30usize]),
24087 tune2: CharArray::new([0_u8; 200usize]),
24088 };
24089 #[cfg(feature = "arbitrary")]
24090 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
24091 use arbitrary::{Arbitrary, Unstructured};
24092 let mut buf = [0u8; 1024];
24093 rng.fill_bytes(&mut buf);
24094 let mut unstructured = Unstructured::new(&buf);
24095 Self::arbitrary(&mut unstructured).unwrap_or_default()
24096 }
24097}
24098impl Default for PLAY_TUNE_DATA {
24099 fn default() -> Self {
24100 Self::DEFAULT.clone()
24101 }
24102}
24103impl MessageData for PLAY_TUNE_DATA {
24104 type Message = MavMessage;
24105 const ID: u32 = 258u32;
24106 const NAME: &'static str = "PLAY_TUNE";
24107 const EXTRA_CRC: u8 = 187u8;
24108 const ENCODED_LEN: usize = 232usize;
24109 fn deser(
24110 _version: MavlinkVersion,
24111 __input: &[u8],
24112 ) -> Result<Self, ::mavlink_core::error::ParserError> {
24113 let avail_len = __input.len();
24114 let mut payload_buf = [0; Self::ENCODED_LEN];
24115 let mut buf = if avail_len < Self::ENCODED_LEN {
24116 payload_buf[0..avail_len].copy_from_slice(__input);
24117 Bytes::new(&payload_buf)
24118 } else {
24119 Bytes::new(__input)
24120 };
24121 let mut __struct = Self::default();
24122 __struct.target_system = buf.get_u8();
24123 __struct.target_component = buf.get_u8();
24124 let mut tmp = [0_u8; 30usize];
24125 for v in &mut tmp {
24126 *v = buf.get_u8();
24127 }
24128 __struct.tune = CharArray::new(tmp);
24129 let mut tmp = [0_u8; 200usize];
24130 for v in &mut tmp {
24131 *v = buf.get_u8();
24132 }
24133 __struct.tune2 = CharArray::new(tmp);
24134 Ok(__struct)
24135 }
24136 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
24137 let mut __tmp = BytesMut::new(bytes);
24138 #[allow(clippy::absurd_extreme_comparisons)]
24139 #[allow(unused_comparisons)]
24140 if __tmp.remaining() < Self::ENCODED_LEN {
24141 panic!(
24142 "buffer is too small (need {} bytes, but got {})",
24143 Self::ENCODED_LEN,
24144 __tmp.remaining(),
24145 )
24146 }
24147 __tmp.put_u8(self.target_system);
24148 __tmp.put_u8(self.target_component);
24149 for val in &self.tune {
24150 __tmp.put_u8(*val);
24151 }
24152 if matches!(version, MavlinkVersion::V2) {
24153 for val in &self.tune2 {
24154 __tmp.put_u8(*val);
24155 }
24156 let len = __tmp.len();
24157 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
24158 } else {
24159 __tmp.len()
24160 }
24161 }
24162}
24163#[doc = "Play vehicle tone/tune (buzzer). Supersedes message PLAY_TUNE."]
24164#[doc = ""]
24165#[doc = "ID: 400"]
24166#[derive(Debug, Clone, PartialEq)]
24167#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
24168#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
24169#[cfg_attr(feature = "ts", derive(TS))]
24170#[cfg_attr(feature = "ts", ts(export))]
24171pub struct PLAY_TUNE_V2_DATA {
24172 #[doc = "Tune format"]
24173 pub format: TuneFormat,
24174 #[doc = "System ID"]
24175 pub target_system: u8,
24176 #[doc = "Component ID"]
24177 pub target_component: u8,
24178 #[doc = "Tune definition as a NULL-terminated string."]
24179 #[cfg_attr(feature = "ts", ts(type = "string"))]
24180 pub tune: CharArray<248>,
24181}
24182impl PLAY_TUNE_V2_DATA {
24183 pub const ENCODED_LEN: usize = 254usize;
24184 pub const DEFAULT: Self = Self {
24185 format: TuneFormat::DEFAULT,
24186 target_system: 0_u8,
24187 target_component: 0_u8,
24188 tune: CharArray::new([0_u8; 248usize]),
24189 };
24190 #[cfg(feature = "arbitrary")]
24191 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
24192 use arbitrary::{Arbitrary, Unstructured};
24193 let mut buf = [0u8; 1024];
24194 rng.fill_bytes(&mut buf);
24195 let mut unstructured = Unstructured::new(&buf);
24196 Self::arbitrary(&mut unstructured).unwrap_or_default()
24197 }
24198}
24199impl Default for PLAY_TUNE_V2_DATA {
24200 fn default() -> Self {
24201 Self::DEFAULT.clone()
24202 }
24203}
24204impl MessageData for PLAY_TUNE_V2_DATA {
24205 type Message = MavMessage;
24206 const ID: u32 = 400u32;
24207 const NAME: &'static str = "PLAY_TUNE_V2";
24208 const EXTRA_CRC: u8 = 110u8;
24209 const ENCODED_LEN: usize = 254usize;
24210 fn deser(
24211 _version: MavlinkVersion,
24212 __input: &[u8],
24213 ) -> Result<Self, ::mavlink_core::error::ParserError> {
24214 let avail_len = __input.len();
24215 let mut payload_buf = [0; Self::ENCODED_LEN];
24216 let mut buf = if avail_len < Self::ENCODED_LEN {
24217 payload_buf[0..avail_len].copy_from_slice(__input);
24218 Bytes::new(&payload_buf)
24219 } else {
24220 Bytes::new(__input)
24221 };
24222 let mut __struct = Self::default();
24223 let tmp = buf.get_u32_le();
24224 __struct.format = FromPrimitive::from_u32(tmp).ok_or(
24225 ::mavlink_core::error::ParserError::InvalidEnum {
24226 enum_type: "TuneFormat",
24227 value: tmp as u64,
24228 },
24229 )?;
24230 __struct.target_system = buf.get_u8();
24231 __struct.target_component = buf.get_u8();
24232 let mut tmp = [0_u8; 248usize];
24233 for v in &mut tmp {
24234 *v = buf.get_u8();
24235 }
24236 __struct.tune = CharArray::new(tmp);
24237 Ok(__struct)
24238 }
24239 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
24240 let mut __tmp = BytesMut::new(bytes);
24241 #[allow(clippy::absurd_extreme_comparisons)]
24242 #[allow(unused_comparisons)]
24243 if __tmp.remaining() < Self::ENCODED_LEN {
24244 panic!(
24245 "buffer is too small (need {} bytes, but got {})",
24246 Self::ENCODED_LEN,
24247 __tmp.remaining(),
24248 )
24249 }
24250 __tmp.put_u32_le(self.format as u32);
24251 __tmp.put_u8(self.target_system);
24252 __tmp.put_u8(self.target_component);
24253 for val in &self.tune {
24254 __tmp.put_u8(*val);
24255 }
24256 if matches!(version, MavlinkVersion::V2) {
24257 let len = __tmp.len();
24258 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
24259 } else {
24260 __tmp.len()
24261 }
24262 }
24263}
24264#[doc = "Reports the current commanded vehicle position, velocity, and acceleration as specified by the autopilot. This should match the commands sent in SET_POSITION_TARGET_GLOBAL_INT if the vehicle is being controlled this way."]
24265#[doc = ""]
24266#[doc = "ID: 87"]
24267#[derive(Debug, Clone, PartialEq)]
24268#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
24269#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
24270#[cfg_attr(feature = "ts", derive(TS))]
24271#[cfg_attr(feature = "ts", ts(export))]
24272pub struct POSITION_TARGET_GLOBAL_INT_DATA {
24273 #[doc = "Timestamp (time since system boot). The rationale for the timestamp in the setpoint is to allow the system to compensate for the transport delay of the setpoint. This allows the system to compensate processing latency."]
24274 pub time_boot_ms: u32,
24275 #[doc = "Latitude in WGS84 frame"]
24276 pub lat_int: i32,
24277 #[doc = "Longitude in WGS84 frame"]
24278 pub lon_int: i32,
24279 #[doc = "Altitude (MSL, AGL or relative to home altitude, depending on frame)"]
24280 pub alt: f32,
24281 #[doc = "X velocity in NED frame"]
24282 pub vx: f32,
24283 #[doc = "Y velocity in NED frame"]
24284 pub vy: f32,
24285 #[doc = "Z velocity in NED frame"]
24286 pub vz: f32,
24287 #[doc = "X acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N"]
24288 pub afx: f32,
24289 #[doc = "Y acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N"]
24290 pub afy: f32,
24291 #[doc = "Z acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N"]
24292 pub afz: f32,
24293 #[doc = "yaw setpoint"]
24294 pub yaw: f32,
24295 #[doc = "yaw rate setpoint"]
24296 pub yaw_rate: f32,
24297 #[doc = "Bitmap to indicate which dimensions should be ignored by the vehicle."]
24298 pub type_mask: PositionTargetTypemask,
24299 #[doc = "Valid options are: MAV_FRAME_GLOBAL = 0, MAV_FRAME_GLOBAL_RELATIVE_ALT = 3, MAV_FRAME_GLOBAL_TERRAIN_ALT = 10 (MAV_FRAME_GLOBAL_INT, MAV_FRAME_GLOBAL_RELATIVE_ALT_INT, MAV_FRAME_GLOBAL_TERRAIN_ALT_INT are allowed synonyms, but have been deprecated)"]
24300 pub coordinate_frame: MavFrame,
24301}
24302impl POSITION_TARGET_GLOBAL_INT_DATA {
24303 pub const ENCODED_LEN: usize = 51usize;
24304 pub const DEFAULT: Self = Self {
24305 time_boot_ms: 0_u32,
24306 lat_int: 0_i32,
24307 lon_int: 0_i32,
24308 alt: 0.0_f32,
24309 vx: 0.0_f32,
24310 vy: 0.0_f32,
24311 vz: 0.0_f32,
24312 afx: 0.0_f32,
24313 afy: 0.0_f32,
24314 afz: 0.0_f32,
24315 yaw: 0.0_f32,
24316 yaw_rate: 0.0_f32,
24317 type_mask: PositionTargetTypemask::DEFAULT,
24318 coordinate_frame: MavFrame::DEFAULT,
24319 };
24320 #[cfg(feature = "arbitrary")]
24321 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
24322 use arbitrary::{Arbitrary, Unstructured};
24323 let mut buf = [0u8; 1024];
24324 rng.fill_bytes(&mut buf);
24325 let mut unstructured = Unstructured::new(&buf);
24326 Self::arbitrary(&mut unstructured).unwrap_or_default()
24327 }
24328}
24329impl Default for POSITION_TARGET_GLOBAL_INT_DATA {
24330 fn default() -> Self {
24331 Self::DEFAULT.clone()
24332 }
24333}
24334impl MessageData for POSITION_TARGET_GLOBAL_INT_DATA {
24335 type Message = MavMessage;
24336 const ID: u32 = 87u32;
24337 const NAME: &'static str = "POSITION_TARGET_GLOBAL_INT";
24338 const EXTRA_CRC: u8 = 150u8;
24339 const ENCODED_LEN: usize = 51usize;
24340 fn deser(
24341 _version: MavlinkVersion,
24342 __input: &[u8],
24343 ) -> Result<Self, ::mavlink_core::error::ParserError> {
24344 let avail_len = __input.len();
24345 let mut payload_buf = [0; Self::ENCODED_LEN];
24346 let mut buf = if avail_len < Self::ENCODED_LEN {
24347 payload_buf[0..avail_len].copy_from_slice(__input);
24348 Bytes::new(&payload_buf)
24349 } else {
24350 Bytes::new(__input)
24351 };
24352 let mut __struct = Self::default();
24353 __struct.time_boot_ms = buf.get_u32_le();
24354 __struct.lat_int = buf.get_i32_le();
24355 __struct.lon_int = buf.get_i32_le();
24356 __struct.alt = buf.get_f32_le();
24357 __struct.vx = buf.get_f32_le();
24358 __struct.vy = buf.get_f32_le();
24359 __struct.vz = buf.get_f32_le();
24360 __struct.afx = buf.get_f32_le();
24361 __struct.afy = buf.get_f32_le();
24362 __struct.afz = buf.get_f32_le();
24363 __struct.yaw = buf.get_f32_le();
24364 __struct.yaw_rate = buf.get_f32_le();
24365 let tmp = buf.get_u16_le();
24366 __struct.type_mask =
24367 PositionTargetTypemask::from_bits(tmp as <PositionTargetTypemask as Flags>::Bits)
24368 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
24369 flag_type: "PositionTargetTypemask",
24370 value: tmp as u64,
24371 })?;
24372 let tmp = buf.get_u8();
24373 __struct.coordinate_frame =
24374 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
24375 enum_type: "MavFrame",
24376 value: tmp as u64,
24377 })?;
24378 Ok(__struct)
24379 }
24380 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
24381 let mut __tmp = BytesMut::new(bytes);
24382 #[allow(clippy::absurd_extreme_comparisons)]
24383 #[allow(unused_comparisons)]
24384 if __tmp.remaining() < Self::ENCODED_LEN {
24385 panic!(
24386 "buffer is too small (need {} bytes, but got {})",
24387 Self::ENCODED_LEN,
24388 __tmp.remaining(),
24389 )
24390 }
24391 __tmp.put_u32_le(self.time_boot_ms);
24392 __tmp.put_i32_le(self.lat_int);
24393 __tmp.put_i32_le(self.lon_int);
24394 __tmp.put_f32_le(self.alt);
24395 __tmp.put_f32_le(self.vx);
24396 __tmp.put_f32_le(self.vy);
24397 __tmp.put_f32_le(self.vz);
24398 __tmp.put_f32_le(self.afx);
24399 __tmp.put_f32_le(self.afy);
24400 __tmp.put_f32_le(self.afz);
24401 __tmp.put_f32_le(self.yaw);
24402 __tmp.put_f32_le(self.yaw_rate);
24403 __tmp.put_u16_le(self.type_mask.bits() as u16);
24404 __tmp.put_u8(self.coordinate_frame as u8);
24405 if matches!(version, MavlinkVersion::V2) {
24406 let len = __tmp.len();
24407 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
24408 } else {
24409 __tmp.len()
24410 }
24411 }
24412}
24413#[doc = "Reports the current commanded vehicle position, velocity, and acceleration as specified by the autopilot. This should match the commands sent in SET_POSITION_TARGET_LOCAL_NED if the vehicle is being controlled this way."]
24414#[doc = ""]
24415#[doc = "ID: 85"]
24416#[derive(Debug, Clone, PartialEq)]
24417#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
24418#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
24419#[cfg_attr(feature = "ts", derive(TS))]
24420#[cfg_attr(feature = "ts", ts(export))]
24421pub struct POSITION_TARGET_LOCAL_NED_DATA {
24422 #[doc = "Timestamp (time since system boot)."]
24423 pub time_boot_ms: u32,
24424 #[doc = "X Position in NED frame"]
24425 pub x: f32,
24426 #[doc = "Y Position in NED frame"]
24427 pub y: f32,
24428 #[doc = "Z Position in NED frame (note, altitude is negative in NED)"]
24429 pub z: f32,
24430 #[doc = "X velocity in NED frame"]
24431 pub vx: f32,
24432 #[doc = "Y velocity in NED frame"]
24433 pub vy: f32,
24434 #[doc = "Z velocity in NED frame"]
24435 pub vz: f32,
24436 #[doc = "X acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N"]
24437 pub afx: f32,
24438 #[doc = "Y acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N"]
24439 pub afy: f32,
24440 #[doc = "Z acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N"]
24441 pub afz: f32,
24442 #[doc = "yaw setpoint"]
24443 pub yaw: f32,
24444 #[doc = "yaw rate setpoint"]
24445 pub yaw_rate: f32,
24446 #[doc = "Bitmap to indicate which dimensions should be ignored by the vehicle."]
24447 pub type_mask: PositionTargetTypemask,
24448 #[doc = "Valid options are: MAV_FRAME_LOCAL_NED = 1, MAV_FRAME_LOCAL_OFFSET_NED = 7, MAV_FRAME_BODY_NED = 8, MAV_FRAME_BODY_OFFSET_NED = 9"]
24449 pub coordinate_frame: MavFrame,
24450}
24451impl POSITION_TARGET_LOCAL_NED_DATA {
24452 pub const ENCODED_LEN: usize = 51usize;
24453 pub const DEFAULT: Self = Self {
24454 time_boot_ms: 0_u32,
24455 x: 0.0_f32,
24456 y: 0.0_f32,
24457 z: 0.0_f32,
24458 vx: 0.0_f32,
24459 vy: 0.0_f32,
24460 vz: 0.0_f32,
24461 afx: 0.0_f32,
24462 afy: 0.0_f32,
24463 afz: 0.0_f32,
24464 yaw: 0.0_f32,
24465 yaw_rate: 0.0_f32,
24466 type_mask: PositionTargetTypemask::DEFAULT,
24467 coordinate_frame: MavFrame::DEFAULT,
24468 };
24469 #[cfg(feature = "arbitrary")]
24470 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
24471 use arbitrary::{Arbitrary, Unstructured};
24472 let mut buf = [0u8; 1024];
24473 rng.fill_bytes(&mut buf);
24474 let mut unstructured = Unstructured::new(&buf);
24475 Self::arbitrary(&mut unstructured).unwrap_or_default()
24476 }
24477}
24478impl Default for POSITION_TARGET_LOCAL_NED_DATA {
24479 fn default() -> Self {
24480 Self::DEFAULT.clone()
24481 }
24482}
24483impl MessageData for POSITION_TARGET_LOCAL_NED_DATA {
24484 type Message = MavMessage;
24485 const ID: u32 = 85u32;
24486 const NAME: &'static str = "POSITION_TARGET_LOCAL_NED";
24487 const EXTRA_CRC: u8 = 140u8;
24488 const ENCODED_LEN: usize = 51usize;
24489 fn deser(
24490 _version: MavlinkVersion,
24491 __input: &[u8],
24492 ) -> Result<Self, ::mavlink_core::error::ParserError> {
24493 let avail_len = __input.len();
24494 let mut payload_buf = [0; Self::ENCODED_LEN];
24495 let mut buf = if avail_len < Self::ENCODED_LEN {
24496 payload_buf[0..avail_len].copy_from_slice(__input);
24497 Bytes::new(&payload_buf)
24498 } else {
24499 Bytes::new(__input)
24500 };
24501 let mut __struct = Self::default();
24502 __struct.time_boot_ms = buf.get_u32_le();
24503 __struct.x = buf.get_f32_le();
24504 __struct.y = buf.get_f32_le();
24505 __struct.z = buf.get_f32_le();
24506 __struct.vx = buf.get_f32_le();
24507 __struct.vy = buf.get_f32_le();
24508 __struct.vz = buf.get_f32_le();
24509 __struct.afx = buf.get_f32_le();
24510 __struct.afy = buf.get_f32_le();
24511 __struct.afz = buf.get_f32_le();
24512 __struct.yaw = buf.get_f32_le();
24513 __struct.yaw_rate = buf.get_f32_le();
24514 let tmp = buf.get_u16_le();
24515 __struct.type_mask =
24516 PositionTargetTypemask::from_bits(tmp as <PositionTargetTypemask as Flags>::Bits)
24517 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
24518 flag_type: "PositionTargetTypemask",
24519 value: tmp as u64,
24520 })?;
24521 let tmp = buf.get_u8();
24522 __struct.coordinate_frame =
24523 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
24524 enum_type: "MavFrame",
24525 value: tmp as u64,
24526 })?;
24527 Ok(__struct)
24528 }
24529 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
24530 let mut __tmp = BytesMut::new(bytes);
24531 #[allow(clippy::absurd_extreme_comparisons)]
24532 #[allow(unused_comparisons)]
24533 if __tmp.remaining() < Self::ENCODED_LEN {
24534 panic!(
24535 "buffer is too small (need {} bytes, but got {})",
24536 Self::ENCODED_LEN,
24537 __tmp.remaining(),
24538 )
24539 }
24540 __tmp.put_u32_le(self.time_boot_ms);
24541 __tmp.put_f32_le(self.x);
24542 __tmp.put_f32_le(self.y);
24543 __tmp.put_f32_le(self.z);
24544 __tmp.put_f32_le(self.vx);
24545 __tmp.put_f32_le(self.vy);
24546 __tmp.put_f32_le(self.vz);
24547 __tmp.put_f32_le(self.afx);
24548 __tmp.put_f32_le(self.afy);
24549 __tmp.put_f32_le(self.afz);
24550 __tmp.put_f32_le(self.yaw);
24551 __tmp.put_f32_le(self.yaw_rate);
24552 __tmp.put_u16_le(self.type_mask.bits() as u16);
24553 __tmp.put_u8(self.coordinate_frame as u8);
24554 if matches!(version, MavlinkVersion::V2) {
24555 let len = __tmp.len();
24556 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
24557 } else {
24558 __tmp.len()
24559 }
24560 }
24561}
24562#[doc = "Power supply status."]
24563#[doc = ""]
24564#[doc = "ID: 125"]
24565#[derive(Debug, Clone, PartialEq)]
24566#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
24567#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
24568#[cfg_attr(feature = "ts", derive(TS))]
24569#[cfg_attr(feature = "ts", ts(export))]
24570pub struct POWER_STATUS_DATA {
24571 #[doc = "5V rail voltage."]
24572 pub Vcc: u16,
24573 #[doc = "Servo rail voltage."]
24574 pub Vservo: u16,
24575 #[doc = "Bitmap of power supply status flags."]
24576 pub flags: MavPowerStatus,
24577}
24578impl POWER_STATUS_DATA {
24579 pub const ENCODED_LEN: usize = 6usize;
24580 pub const DEFAULT: Self = Self {
24581 Vcc: 0_u16,
24582 Vservo: 0_u16,
24583 flags: MavPowerStatus::DEFAULT,
24584 };
24585 #[cfg(feature = "arbitrary")]
24586 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
24587 use arbitrary::{Arbitrary, Unstructured};
24588 let mut buf = [0u8; 1024];
24589 rng.fill_bytes(&mut buf);
24590 let mut unstructured = Unstructured::new(&buf);
24591 Self::arbitrary(&mut unstructured).unwrap_or_default()
24592 }
24593}
24594impl Default for POWER_STATUS_DATA {
24595 fn default() -> Self {
24596 Self::DEFAULT.clone()
24597 }
24598}
24599impl MessageData for POWER_STATUS_DATA {
24600 type Message = MavMessage;
24601 const ID: u32 = 125u32;
24602 const NAME: &'static str = "POWER_STATUS";
24603 const EXTRA_CRC: u8 = 203u8;
24604 const ENCODED_LEN: usize = 6usize;
24605 fn deser(
24606 _version: MavlinkVersion,
24607 __input: &[u8],
24608 ) -> Result<Self, ::mavlink_core::error::ParserError> {
24609 let avail_len = __input.len();
24610 let mut payload_buf = [0; Self::ENCODED_LEN];
24611 let mut buf = if avail_len < Self::ENCODED_LEN {
24612 payload_buf[0..avail_len].copy_from_slice(__input);
24613 Bytes::new(&payload_buf)
24614 } else {
24615 Bytes::new(__input)
24616 };
24617 let mut __struct = Self::default();
24618 __struct.Vcc = buf.get_u16_le();
24619 __struct.Vservo = buf.get_u16_le();
24620 let tmp = buf.get_u16_le();
24621 __struct.flags = MavPowerStatus::from_bits(tmp as <MavPowerStatus as Flags>::Bits).ok_or(
24622 ::mavlink_core::error::ParserError::InvalidFlag {
24623 flag_type: "MavPowerStatus",
24624 value: tmp as u64,
24625 },
24626 )?;
24627 Ok(__struct)
24628 }
24629 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
24630 let mut __tmp = BytesMut::new(bytes);
24631 #[allow(clippy::absurd_extreme_comparisons)]
24632 #[allow(unused_comparisons)]
24633 if __tmp.remaining() < Self::ENCODED_LEN {
24634 panic!(
24635 "buffer is too small (need {} bytes, but got {})",
24636 Self::ENCODED_LEN,
24637 __tmp.remaining(),
24638 )
24639 }
24640 __tmp.put_u16_le(self.Vcc);
24641 __tmp.put_u16_le(self.Vservo);
24642 __tmp.put_u16_le(self.flags.bits() as u16);
24643 if matches!(version, MavlinkVersion::V2) {
24644 let len = __tmp.len();
24645 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
24646 } else {
24647 __tmp.len()
24648 }
24649 }
24650}
24651#[doc = "Version and capability of protocol version. This message can be requested with MAV_CMD_REQUEST_MESSAGE and is used as part of the handshaking to establish which MAVLink version should be used on the network. Every node should respond to a request for PROTOCOL_VERSION to enable the handshaking. Library implementers should consider adding this into the default decoding state machine to allow the protocol core to respond directly."]
24652#[doc = ""]
24653#[doc = "ID: 300"]
24654#[derive(Debug, Clone, PartialEq)]
24655#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
24656#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
24657#[cfg_attr(feature = "ts", derive(TS))]
24658#[cfg_attr(feature = "ts", ts(export))]
24659pub struct PROTOCOL_VERSION_DATA {
24660 #[doc = "Currently active MAVLink version number * 100: v1.0 is 100, v2.0 is 200, etc."]
24661 pub version: u16,
24662 #[doc = "Minimum MAVLink version supported"]
24663 pub min_version: u16,
24664 #[doc = "Maximum MAVLink version supported (set to the same value as version by default)"]
24665 pub max_version: u16,
24666 #[doc = "The first 8 bytes (not characters printed in hex!) of the git hash."]
24667 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
24668 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
24669 pub spec_version_hash: [u8; 8],
24670 #[doc = "The first 8 bytes (not characters printed in hex!) of the git hash."]
24671 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
24672 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
24673 pub library_version_hash: [u8; 8],
24674}
24675impl PROTOCOL_VERSION_DATA {
24676 pub const ENCODED_LEN: usize = 22usize;
24677 pub const DEFAULT: Self = Self {
24678 version: 0_u16,
24679 min_version: 0_u16,
24680 max_version: 0_u16,
24681 spec_version_hash: [0_u8; 8usize],
24682 library_version_hash: [0_u8; 8usize],
24683 };
24684 #[cfg(feature = "arbitrary")]
24685 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
24686 use arbitrary::{Arbitrary, Unstructured};
24687 let mut buf = [0u8; 1024];
24688 rng.fill_bytes(&mut buf);
24689 let mut unstructured = Unstructured::new(&buf);
24690 Self::arbitrary(&mut unstructured).unwrap_or_default()
24691 }
24692}
24693impl Default for PROTOCOL_VERSION_DATA {
24694 fn default() -> Self {
24695 Self::DEFAULT.clone()
24696 }
24697}
24698impl MessageData for PROTOCOL_VERSION_DATA {
24699 type Message = MavMessage;
24700 const ID: u32 = 300u32;
24701 const NAME: &'static str = "PROTOCOL_VERSION";
24702 const EXTRA_CRC: u8 = 217u8;
24703 const ENCODED_LEN: usize = 22usize;
24704 fn deser(
24705 _version: MavlinkVersion,
24706 __input: &[u8],
24707 ) -> Result<Self, ::mavlink_core::error::ParserError> {
24708 let avail_len = __input.len();
24709 let mut payload_buf = [0; Self::ENCODED_LEN];
24710 let mut buf = if avail_len < Self::ENCODED_LEN {
24711 payload_buf[0..avail_len].copy_from_slice(__input);
24712 Bytes::new(&payload_buf)
24713 } else {
24714 Bytes::new(__input)
24715 };
24716 let mut __struct = Self::default();
24717 __struct.version = buf.get_u16_le();
24718 __struct.min_version = buf.get_u16_le();
24719 __struct.max_version = buf.get_u16_le();
24720 for v in &mut __struct.spec_version_hash {
24721 let val = buf.get_u8();
24722 *v = val;
24723 }
24724 for v in &mut __struct.library_version_hash {
24725 let val = buf.get_u8();
24726 *v = val;
24727 }
24728 Ok(__struct)
24729 }
24730 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
24731 let mut __tmp = BytesMut::new(bytes);
24732 #[allow(clippy::absurd_extreme_comparisons)]
24733 #[allow(unused_comparisons)]
24734 if __tmp.remaining() < Self::ENCODED_LEN {
24735 panic!(
24736 "buffer is too small (need {} bytes, but got {})",
24737 Self::ENCODED_LEN,
24738 __tmp.remaining(),
24739 )
24740 }
24741 __tmp.put_u16_le(self.version);
24742 __tmp.put_u16_le(self.min_version);
24743 __tmp.put_u16_le(self.max_version);
24744 for val in &self.spec_version_hash {
24745 __tmp.put_u8(*val);
24746 }
24747 for val in &self.library_version_hash {
24748 __tmp.put_u8(*val);
24749 }
24750 if matches!(version, MavlinkVersion::V2) {
24751 let len = __tmp.len();
24752 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
24753 } else {
24754 __tmp.len()
24755 }
24756 }
24757}
24758#[doc = "Status generated by radio and injected into MAVLink stream."]
24759#[doc = ""]
24760#[doc = "ID: 109"]
24761#[derive(Debug, Clone, PartialEq)]
24762#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
24763#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
24764#[cfg_attr(feature = "ts", derive(TS))]
24765#[cfg_attr(feature = "ts", ts(export))]
24766pub struct RADIO_STATUS_DATA {
24767 #[doc = "Count of radio packet receive errors (since boot)."]
24768 pub rxerrors: u16,
24769 #[doc = "Count of error corrected radio packets (since boot)."]
24770 pub fixed: u16,
24771 #[doc = "Local (message sender) received signal strength indication in device-dependent units/scale. Values: [0-254], UINT8_MAX: invalid/unknown."]
24772 pub rssi: u8,
24773 #[doc = "Remote (message receiver) signal strength indication in device-dependent units/scale. Values: [0-254], UINT8_MAX: invalid/unknown."]
24774 pub remrssi: u8,
24775 #[doc = "Remaining free transmitter buffer space."]
24776 pub txbuf: u8,
24777 #[doc = "Local background noise level. These are device dependent RSSI values (scale as approx 2x dB on SiK radios). Values: [0-254], UINT8_MAX: invalid/unknown."]
24778 pub noise: u8,
24779 #[doc = "Remote background noise level. These are device dependent RSSI values (scale as approx 2x dB on SiK radios). Values: [0-254], UINT8_MAX: invalid/unknown."]
24780 pub remnoise: u8,
24781}
24782impl RADIO_STATUS_DATA {
24783 pub const ENCODED_LEN: usize = 9usize;
24784 pub const DEFAULT: Self = Self {
24785 rxerrors: 0_u16,
24786 fixed: 0_u16,
24787 rssi: 0_u8,
24788 remrssi: 0_u8,
24789 txbuf: 0_u8,
24790 noise: 0_u8,
24791 remnoise: 0_u8,
24792 };
24793 #[cfg(feature = "arbitrary")]
24794 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
24795 use arbitrary::{Arbitrary, Unstructured};
24796 let mut buf = [0u8; 1024];
24797 rng.fill_bytes(&mut buf);
24798 let mut unstructured = Unstructured::new(&buf);
24799 Self::arbitrary(&mut unstructured).unwrap_or_default()
24800 }
24801}
24802impl Default for RADIO_STATUS_DATA {
24803 fn default() -> Self {
24804 Self::DEFAULT.clone()
24805 }
24806}
24807impl MessageData for RADIO_STATUS_DATA {
24808 type Message = MavMessage;
24809 const ID: u32 = 109u32;
24810 const NAME: &'static str = "RADIO_STATUS";
24811 const EXTRA_CRC: u8 = 185u8;
24812 const ENCODED_LEN: usize = 9usize;
24813 fn deser(
24814 _version: MavlinkVersion,
24815 __input: &[u8],
24816 ) -> Result<Self, ::mavlink_core::error::ParserError> {
24817 let avail_len = __input.len();
24818 let mut payload_buf = [0; Self::ENCODED_LEN];
24819 let mut buf = if avail_len < Self::ENCODED_LEN {
24820 payload_buf[0..avail_len].copy_from_slice(__input);
24821 Bytes::new(&payload_buf)
24822 } else {
24823 Bytes::new(__input)
24824 };
24825 let mut __struct = Self::default();
24826 __struct.rxerrors = buf.get_u16_le();
24827 __struct.fixed = buf.get_u16_le();
24828 __struct.rssi = buf.get_u8();
24829 __struct.remrssi = buf.get_u8();
24830 __struct.txbuf = buf.get_u8();
24831 __struct.noise = buf.get_u8();
24832 __struct.remnoise = buf.get_u8();
24833 Ok(__struct)
24834 }
24835 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
24836 let mut __tmp = BytesMut::new(bytes);
24837 #[allow(clippy::absurd_extreme_comparisons)]
24838 #[allow(unused_comparisons)]
24839 if __tmp.remaining() < Self::ENCODED_LEN {
24840 panic!(
24841 "buffer is too small (need {} bytes, but got {})",
24842 Self::ENCODED_LEN,
24843 __tmp.remaining(),
24844 )
24845 }
24846 __tmp.put_u16_le(self.rxerrors);
24847 __tmp.put_u16_le(self.fixed);
24848 __tmp.put_u8(self.rssi);
24849 __tmp.put_u8(self.remrssi);
24850 __tmp.put_u8(self.txbuf);
24851 __tmp.put_u8(self.noise);
24852 __tmp.put_u8(self.remnoise);
24853 if matches!(version, MavlinkVersion::V2) {
24854 let len = __tmp.len();
24855 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
24856 } else {
24857 __tmp.len()
24858 }
24859 }
24860}
24861#[doc = "The RAW IMU readings for a 9DOF sensor, which is identified by the id (default IMU1). This message should always contain the true raw values without any scaling to allow data capture and system debugging."]
24862#[doc = ""]
24863#[doc = "ID: 27"]
24864#[derive(Debug, Clone, PartialEq)]
24865#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
24866#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
24867#[cfg_attr(feature = "ts", derive(TS))]
24868#[cfg_attr(feature = "ts", ts(export))]
24869pub struct RAW_IMU_DATA {
24870 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
24871 pub time_usec: u64,
24872 #[doc = "X acceleration (raw)"]
24873 pub xacc: i16,
24874 #[doc = "Y acceleration (raw)"]
24875 pub yacc: i16,
24876 #[doc = "Z acceleration (raw)"]
24877 pub zacc: i16,
24878 #[doc = "Angular speed around X axis (raw)"]
24879 pub xgyro: i16,
24880 #[doc = "Angular speed around Y axis (raw)"]
24881 pub ygyro: i16,
24882 #[doc = "Angular speed around Z axis (raw)"]
24883 pub zgyro: i16,
24884 #[doc = "X Magnetic field (raw)"]
24885 pub xmag: i16,
24886 #[doc = "Y Magnetic field (raw)"]
24887 pub ymag: i16,
24888 #[doc = "Z Magnetic field (raw)"]
24889 pub zmag: i16,
24890 #[doc = "Id. Ids are numbered from 0 and map to IMUs numbered from 1 (e.g. IMU1 will have a message with id=0)"]
24891 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
24892 pub id: u8,
24893 #[doc = "Temperature, 0: IMU does not provide temperature values. If the IMU is at 0C it must send 1 (0.01C)."]
24894 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
24895 pub temperature: i16,
24896}
24897impl RAW_IMU_DATA {
24898 pub const ENCODED_LEN: usize = 29usize;
24899 pub const DEFAULT: Self = Self {
24900 time_usec: 0_u64,
24901 xacc: 0_i16,
24902 yacc: 0_i16,
24903 zacc: 0_i16,
24904 xgyro: 0_i16,
24905 ygyro: 0_i16,
24906 zgyro: 0_i16,
24907 xmag: 0_i16,
24908 ymag: 0_i16,
24909 zmag: 0_i16,
24910 id: 0_u8,
24911 temperature: 0_i16,
24912 };
24913 #[cfg(feature = "arbitrary")]
24914 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
24915 use arbitrary::{Arbitrary, Unstructured};
24916 let mut buf = [0u8; 1024];
24917 rng.fill_bytes(&mut buf);
24918 let mut unstructured = Unstructured::new(&buf);
24919 Self::arbitrary(&mut unstructured).unwrap_or_default()
24920 }
24921}
24922impl Default for RAW_IMU_DATA {
24923 fn default() -> Self {
24924 Self::DEFAULT.clone()
24925 }
24926}
24927impl MessageData for RAW_IMU_DATA {
24928 type Message = MavMessage;
24929 const ID: u32 = 27u32;
24930 const NAME: &'static str = "RAW_IMU";
24931 const EXTRA_CRC: u8 = 144u8;
24932 const ENCODED_LEN: usize = 29usize;
24933 fn deser(
24934 _version: MavlinkVersion,
24935 __input: &[u8],
24936 ) -> Result<Self, ::mavlink_core::error::ParserError> {
24937 let avail_len = __input.len();
24938 let mut payload_buf = [0; Self::ENCODED_LEN];
24939 let mut buf = if avail_len < Self::ENCODED_LEN {
24940 payload_buf[0..avail_len].copy_from_slice(__input);
24941 Bytes::new(&payload_buf)
24942 } else {
24943 Bytes::new(__input)
24944 };
24945 let mut __struct = Self::default();
24946 __struct.time_usec = buf.get_u64_le();
24947 __struct.xacc = buf.get_i16_le();
24948 __struct.yacc = buf.get_i16_le();
24949 __struct.zacc = buf.get_i16_le();
24950 __struct.xgyro = buf.get_i16_le();
24951 __struct.ygyro = buf.get_i16_le();
24952 __struct.zgyro = buf.get_i16_le();
24953 __struct.xmag = buf.get_i16_le();
24954 __struct.ymag = buf.get_i16_le();
24955 __struct.zmag = buf.get_i16_le();
24956 __struct.id = buf.get_u8();
24957 __struct.temperature = buf.get_i16_le();
24958 Ok(__struct)
24959 }
24960 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
24961 let mut __tmp = BytesMut::new(bytes);
24962 #[allow(clippy::absurd_extreme_comparisons)]
24963 #[allow(unused_comparisons)]
24964 if __tmp.remaining() < Self::ENCODED_LEN {
24965 panic!(
24966 "buffer is too small (need {} bytes, but got {})",
24967 Self::ENCODED_LEN,
24968 __tmp.remaining(),
24969 )
24970 }
24971 __tmp.put_u64_le(self.time_usec);
24972 __tmp.put_i16_le(self.xacc);
24973 __tmp.put_i16_le(self.yacc);
24974 __tmp.put_i16_le(self.zacc);
24975 __tmp.put_i16_le(self.xgyro);
24976 __tmp.put_i16_le(self.ygyro);
24977 __tmp.put_i16_le(self.zgyro);
24978 __tmp.put_i16_le(self.xmag);
24979 __tmp.put_i16_le(self.ymag);
24980 __tmp.put_i16_le(self.zmag);
24981 if matches!(version, MavlinkVersion::V2) {
24982 __tmp.put_u8(self.id);
24983 __tmp.put_i16_le(self.temperature);
24984 let len = __tmp.len();
24985 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
24986 } else {
24987 __tmp.len()
24988 }
24989 }
24990}
24991#[doc = "The RAW pressure readings for the typical setup of one absolute pressure and one differential pressure sensor. The sensor values should be the raw, UNSCALED ADC values."]
24992#[doc = ""]
24993#[doc = "ID: 28"]
24994#[derive(Debug, Clone, PartialEq)]
24995#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
24996#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
24997#[cfg_attr(feature = "ts", derive(TS))]
24998#[cfg_attr(feature = "ts", ts(export))]
24999pub struct RAW_PRESSURE_DATA {
25000 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
25001 pub time_usec: u64,
25002 #[doc = "Absolute pressure (raw)"]
25003 pub press_abs: i16,
25004 #[doc = "Differential pressure 1 (raw, 0 if nonexistent)"]
25005 pub press_diff1: i16,
25006 #[doc = "Differential pressure 2 (raw, 0 if nonexistent)"]
25007 pub press_diff2: i16,
25008 #[doc = "Raw Temperature measurement (raw)"]
25009 pub temperature: i16,
25010}
25011impl RAW_PRESSURE_DATA {
25012 pub const ENCODED_LEN: usize = 16usize;
25013 pub const DEFAULT: Self = Self {
25014 time_usec: 0_u64,
25015 press_abs: 0_i16,
25016 press_diff1: 0_i16,
25017 press_diff2: 0_i16,
25018 temperature: 0_i16,
25019 };
25020 #[cfg(feature = "arbitrary")]
25021 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
25022 use arbitrary::{Arbitrary, Unstructured};
25023 let mut buf = [0u8; 1024];
25024 rng.fill_bytes(&mut buf);
25025 let mut unstructured = Unstructured::new(&buf);
25026 Self::arbitrary(&mut unstructured).unwrap_or_default()
25027 }
25028}
25029impl Default for RAW_PRESSURE_DATA {
25030 fn default() -> Self {
25031 Self::DEFAULT.clone()
25032 }
25033}
25034impl MessageData for RAW_PRESSURE_DATA {
25035 type Message = MavMessage;
25036 const ID: u32 = 28u32;
25037 const NAME: &'static str = "RAW_PRESSURE";
25038 const EXTRA_CRC: u8 = 67u8;
25039 const ENCODED_LEN: usize = 16usize;
25040 fn deser(
25041 _version: MavlinkVersion,
25042 __input: &[u8],
25043 ) -> Result<Self, ::mavlink_core::error::ParserError> {
25044 let avail_len = __input.len();
25045 let mut payload_buf = [0; Self::ENCODED_LEN];
25046 let mut buf = if avail_len < Self::ENCODED_LEN {
25047 payload_buf[0..avail_len].copy_from_slice(__input);
25048 Bytes::new(&payload_buf)
25049 } else {
25050 Bytes::new(__input)
25051 };
25052 let mut __struct = Self::default();
25053 __struct.time_usec = buf.get_u64_le();
25054 __struct.press_abs = buf.get_i16_le();
25055 __struct.press_diff1 = buf.get_i16_le();
25056 __struct.press_diff2 = buf.get_i16_le();
25057 __struct.temperature = buf.get_i16_le();
25058 Ok(__struct)
25059 }
25060 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
25061 let mut __tmp = BytesMut::new(bytes);
25062 #[allow(clippy::absurd_extreme_comparisons)]
25063 #[allow(unused_comparisons)]
25064 if __tmp.remaining() < Self::ENCODED_LEN {
25065 panic!(
25066 "buffer is too small (need {} bytes, but got {})",
25067 Self::ENCODED_LEN,
25068 __tmp.remaining(),
25069 )
25070 }
25071 __tmp.put_u64_le(self.time_usec);
25072 __tmp.put_i16_le(self.press_abs);
25073 __tmp.put_i16_le(self.press_diff1);
25074 __tmp.put_i16_le(self.press_diff2);
25075 __tmp.put_i16_le(self.temperature);
25076 if matches!(version, MavlinkVersion::V2) {
25077 let len = __tmp.len();
25078 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
25079 } else {
25080 __tmp.len()
25081 }
25082 }
25083}
25084#[doc = "RPM sensor data message."]
25085#[doc = ""]
25086#[doc = "ID: 339"]
25087#[derive(Debug, Clone, PartialEq)]
25088#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
25089#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
25090#[cfg_attr(feature = "ts", derive(TS))]
25091#[cfg_attr(feature = "ts", ts(export))]
25092pub struct RAW_RPM_DATA {
25093 #[doc = "Indicated rate"]
25094 pub frequency: f32,
25095 #[doc = "Index of this RPM sensor (0-indexed)"]
25096 pub index: u8,
25097}
25098impl RAW_RPM_DATA {
25099 pub const ENCODED_LEN: usize = 5usize;
25100 pub const DEFAULT: Self = Self {
25101 frequency: 0.0_f32,
25102 index: 0_u8,
25103 };
25104 #[cfg(feature = "arbitrary")]
25105 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
25106 use arbitrary::{Arbitrary, Unstructured};
25107 let mut buf = [0u8; 1024];
25108 rng.fill_bytes(&mut buf);
25109 let mut unstructured = Unstructured::new(&buf);
25110 Self::arbitrary(&mut unstructured).unwrap_or_default()
25111 }
25112}
25113impl Default for RAW_RPM_DATA {
25114 fn default() -> Self {
25115 Self::DEFAULT.clone()
25116 }
25117}
25118impl MessageData for RAW_RPM_DATA {
25119 type Message = MavMessage;
25120 const ID: u32 = 339u32;
25121 const NAME: &'static str = "RAW_RPM";
25122 const EXTRA_CRC: u8 = 199u8;
25123 const ENCODED_LEN: usize = 5usize;
25124 fn deser(
25125 _version: MavlinkVersion,
25126 __input: &[u8],
25127 ) -> Result<Self, ::mavlink_core::error::ParserError> {
25128 let avail_len = __input.len();
25129 let mut payload_buf = [0; Self::ENCODED_LEN];
25130 let mut buf = if avail_len < Self::ENCODED_LEN {
25131 payload_buf[0..avail_len].copy_from_slice(__input);
25132 Bytes::new(&payload_buf)
25133 } else {
25134 Bytes::new(__input)
25135 };
25136 let mut __struct = Self::default();
25137 __struct.frequency = buf.get_f32_le();
25138 __struct.index = buf.get_u8();
25139 Ok(__struct)
25140 }
25141 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
25142 let mut __tmp = BytesMut::new(bytes);
25143 #[allow(clippy::absurd_extreme_comparisons)]
25144 #[allow(unused_comparisons)]
25145 if __tmp.remaining() < Self::ENCODED_LEN {
25146 panic!(
25147 "buffer is too small (need {} bytes, but got {})",
25148 Self::ENCODED_LEN,
25149 __tmp.remaining(),
25150 )
25151 }
25152 __tmp.put_f32_le(self.frequency);
25153 __tmp.put_u8(self.index);
25154 if matches!(version, MavlinkVersion::V2) {
25155 let len = __tmp.len();
25156 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
25157 } else {
25158 __tmp.len()
25159 }
25160 }
25161}
25162#[doc = "The PPM values of the RC channels received. The standard PPM modulation is as follows: 1000 microseconds: 0%, 2000 microseconds: 100%. A value of UINT16_MAX implies the channel is unused. Individual receivers/transmitters might violate this specification."]
25163#[doc = ""]
25164#[doc = "ID: 65"]
25165#[derive(Debug, Clone, PartialEq)]
25166#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
25167#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
25168#[cfg_attr(feature = "ts", derive(TS))]
25169#[cfg_attr(feature = "ts", ts(export))]
25170pub struct RC_CHANNELS_DATA {
25171 #[doc = "Timestamp (time since system boot)."]
25172 pub time_boot_ms: u32,
25173 #[doc = "RC channel 1 value."]
25174 pub chan1_raw: u16,
25175 #[doc = "RC channel 2 value."]
25176 pub chan2_raw: u16,
25177 #[doc = "RC channel 3 value."]
25178 pub chan3_raw: u16,
25179 #[doc = "RC channel 4 value."]
25180 pub chan4_raw: u16,
25181 #[doc = "RC channel 5 value."]
25182 pub chan5_raw: u16,
25183 #[doc = "RC channel 6 value."]
25184 pub chan6_raw: u16,
25185 #[doc = "RC channel 7 value."]
25186 pub chan7_raw: u16,
25187 #[doc = "RC channel 8 value."]
25188 pub chan8_raw: u16,
25189 #[doc = "RC channel 9 value."]
25190 pub chan9_raw: u16,
25191 #[doc = "RC channel 10 value."]
25192 pub chan10_raw: u16,
25193 #[doc = "RC channel 11 value."]
25194 pub chan11_raw: u16,
25195 #[doc = "RC channel 12 value."]
25196 pub chan12_raw: u16,
25197 #[doc = "RC channel 13 value."]
25198 pub chan13_raw: u16,
25199 #[doc = "RC channel 14 value."]
25200 pub chan14_raw: u16,
25201 #[doc = "RC channel 15 value."]
25202 pub chan15_raw: u16,
25203 #[doc = "RC channel 16 value."]
25204 pub chan16_raw: u16,
25205 #[doc = "RC channel 17 value."]
25206 pub chan17_raw: u16,
25207 #[doc = "RC channel 18 value."]
25208 pub chan18_raw: u16,
25209 #[doc = "Total number of RC channels being received. This can be larger than 18, indicating that more channels are available but not given in this message. This value should be 0 when no RC channels are available."]
25210 pub chancount: u8,
25211 #[doc = "Receive signal strength indicator in device-dependent units/scale. Values: [0-254], UINT8_MAX: invalid/unknown."]
25212 pub rssi: u8,
25213}
25214impl RC_CHANNELS_DATA {
25215 pub const ENCODED_LEN: usize = 42usize;
25216 pub const DEFAULT: Self = Self {
25217 time_boot_ms: 0_u32,
25218 chan1_raw: 0_u16,
25219 chan2_raw: 0_u16,
25220 chan3_raw: 0_u16,
25221 chan4_raw: 0_u16,
25222 chan5_raw: 0_u16,
25223 chan6_raw: 0_u16,
25224 chan7_raw: 0_u16,
25225 chan8_raw: 0_u16,
25226 chan9_raw: 0_u16,
25227 chan10_raw: 0_u16,
25228 chan11_raw: 0_u16,
25229 chan12_raw: 0_u16,
25230 chan13_raw: 0_u16,
25231 chan14_raw: 0_u16,
25232 chan15_raw: 0_u16,
25233 chan16_raw: 0_u16,
25234 chan17_raw: 0_u16,
25235 chan18_raw: 0_u16,
25236 chancount: 0_u8,
25237 rssi: 0_u8,
25238 };
25239 #[cfg(feature = "arbitrary")]
25240 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
25241 use arbitrary::{Arbitrary, Unstructured};
25242 let mut buf = [0u8; 1024];
25243 rng.fill_bytes(&mut buf);
25244 let mut unstructured = Unstructured::new(&buf);
25245 Self::arbitrary(&mut unstructured).unwrap_or_default()
25246 }
25247}
25248impl Default for RC_CHANNELS_DATA {
25249 fn default() -> Self {
25250 Self::DEFAULT.clone()
25251 }
25252}
25253impl MessageData for RC_CHANNELS_DATA {
25254 type Message = MavMessage;
25255 const ID: u32 = 65u32;
25256 const NAME: &'static str = "RC_CHANNELS";
25257 const EXTRA_CRC: u8 = 118u8;
25258 const ENCODED_LEN: usize = 42usize;
25259 fn deser(
25260 _version: MavlinkVersion,
25261 __input: &[u8],
25262 ) -> Result<Self, ::mavlink_core::error::ParserError> {
25263 let avail_len = __input.len();
25264 let mut payload_buf = [0; Self::ENCODED_LEN];
25265 let mut buf = if avail_len < Self::ENCODED_LEN {
25266 payload_buf[0..avail_len].copy_from_slice(__input);
25267 Bytes::new(&payload_buf)
25268 } else {
25269 Bytes::new(__input)
25270 };
25271 let mut __struct = Self::default();
25272 __struct.time_boot_ms = buf.get_u32_le();
25273 __struct.chan1_raw = buf.get_u16_le();
25274 __struct.chan2_raw = buf.get_u16_le();
25275 __struct.chan3_raw = buf.get_u16_le();
25276 __struct.chan4_raw = buf.get_u16_le();
25277 __struct.chan5_raw = buf.get_u16_le();
25278 __struct.chan6_raw = buf.get_u16_le();
25279 __struct.chan7_raw = buf.get_u16_le();
25280 __struct.chan8_raw = buf.get_u16_le();
25281 __struct.chan9_raw = buf.get_u16_le();
25282 __struct.chan10_raw = buf.get_u16_le();
25283 __struct.chan11_raw = buf.get_u16_le();
25284 __struct.chan12_raw = buf.get_u16_le();
25285 __struct.chan13_raw = buf.get_u16_le();
25286 __struct.chan14_raw = buf.get_u16_le();
25287 __struct.chan15_raw = buf.get_u16_le();
25288 __struct.chan16_raw = buf.get_u16_le();
25289 __struct.chan17_raw = buf.get_u16_le();
25290 __struct.chan18_raw = buf.get_u16_le();
25291 __struct.chancount = buf.get_u8();
25292 __struct.rssi = buf.get_u8();
25293 Ok(__struct)
25294 }
25295 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
25296 let mut __tmp = BytesMut::new(bytes);
25297 #[allow(clippy::absurd_extreme_comparisons)]
25298 #[allow(unused_comparisons)]
25299 if __tmp.remaining() < Self::ENCODED_LEN {
25300 panic!(
25301 "buffer is too small (need {} bytes, but got {})",
25302 Self::ENCODED_LEN,
25303 __tmp.remaining(),
25304 )
25305 }
25306 __tmp.put_u32_le(self.time_boot_ms);
25307 __tmp.put_u16_le(self.chan1_raw);
25308 __tmp.put_u16_le(self.chan2_raw);
25309 __tmp.put_u16_le(self.chan3_raw);
25310 __tmp.put_u16_le(self.chan4_raw);
25311 __tmp.put_u16_le(self.chan5_raw);
25312 __tmp.put_u16_le(self.chan6_raw);
25313 __tmp.put_u16_le(self.chan7_raw);
25314 __tmp.put_u16_le(self.chan8_raw);
25315 __tmp.put_u16_le(self.chan9_raw);
25316 __tmp.put_u16_le(self.chan10_raw);
25317 __tmp.put_u16_le(self.chan11_raw);
25318 __tmp.put_u16_le(self.chan12_raw);
25319 __tmp.put_u16_le(self.chan13_raw);
25320 __tmp.put_u16_le(self.chan14_raw);
25321 __tmp.put_u16_le(self.chan15_raw);
25322 __tmp.put_u16_le(self.chan16_raw);
25323 __tmp.put_u16_le(self.chan17_raw);
25324 __tmp.put_u16_le(self.chan18_raw);
25325 __tmp.put_u8(self.chancount);
25326 __tmp.put_u8(self.rssi);
25327 if matches!(version, MavlinkVersion::V2) {
25328 let len = __tmp.len();
25329 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
25330 } else {
25331 __tmp.len()
25332 }
25333 }
25334}
25335#[doc = "The RAW values of the RC channels sent to the MAV to override info received from the RC radio. The standard PPM modulation is as follows: 1000 microseconds: 0%, 2000 microseconds: 100%. Individual receivers/transmitters might violate this specification. Note carefully the semantic differences between the first 8 channels and the subsequent channels."]
25336#[doc = ""]
25337#[doc = "ID: 70"]
25338#[derive(Debug, Clone, PartialEq)]
25339#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
25340#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
25341#[cfg_attr(feature = "ts", derive(TS))]
25342#[cfg_attr(feature = "ts", ts(export))]
25343pub struct RC_CHANNELS_OVERRIDE_DATA {
25344 #[doc = "RC channel 1 value. A value of UINT16_MAX means to ignore this field. A value of 0 means to release this channel back to the RC radio."]
25345 pub chan1_raw: u16,
25346 #[doc = "RC channel 2 value. A value of UINT16_MAX means to ignore this field. A value of 0 means to release this channel back to the RC radio."]
25347 pub chan2_raw: u16,
25348 #[doc = "RC channel 3 value. A value of UINT16_MAX means to ignore this field. A value of 0 means to release this channel back to the RC radio."]
25349 pub chan3_raw: u16,
25350 #[doc = "RC channel 4 value. A value of UINT16_MAX means to ignore this field. A value of 0 means to release this channel back to the RC radio."]
25351 pub chan4_raw: u16,
25352 #[doc = "RC channel 5 value. A value of UINT16_MAX means to ignore this field. A value of 0 means to release this channel back to the RC radio."]
25353 pub chan5_raw: u16,
25354 #[doc = "RC channel 6 value. A value of UINT16_MAX means to ignore this field. A value of 0 means to release this channel back to the RC radio."]
25355 pub chan6_raw: u16,
25356 #[doc = "RC channel 7 value. A value of UINT16_MAX means to ignore this field. A value of 0 means to release this channel back to the RC radio."]
25357 pub chan7_raw: u16,
25358 #[doc = "RC channel 8 value. A value of UINT16_MAX means to ignore this field. A value of 0 means to release this channel back to the RC radio."]
25359 pub chan8_raw: u16,
25360 #[doc = "System ID"]
25361 pub target_system: u8,
25362 #[doc = "Component ID"]
25363 pub target_component: u8,
25364 #[doc = "RC channel 9 value. A value of 0 or UINT16_MAX means to ignore this field. A value of UINT16_MAX-1 means to release this channel back to the RC radio."]
25365 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
25366 pub chan9_raw: u16,
25367 #[doc = "RC channel 10 value. A value of 0 or UINT16_MAX means to ignore this field. A value of UINT16_MAX-1 means to release this channel back to the RC radio."]
25368 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
25369 pub chan10_raw: u16,
25370 #[doc = "RC channel 11 value. A value of 0 or UINT16_MAX means to ignore this field. A value of UINT16_MAX-1 means to release this channel back to the RC radio."]
25371 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
25372 pub chan11_raw: u16,
25373 #[doc = "RC channel 12 value. A value of 0 or UINT16_MAX means to ignore this field. A value of UINT16_MAX-1 means to release this channel back to the RC radio."]
25374 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
25375 pub chan12_raw: u16,
25376 #[doc = "RC channel 13 value. A value of 0 or UINT16_MAX means to ignore this field. A value of UINT16_MAX-1 means to release this channel back to the RC radio."]
25377 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
25378 pub chan13_raw: u16,
25379 #[doc = "RC channel 14 value. A value of 0 or UINT16_MAX means to ignore this field. A value of UINT16_MAX-1 means to release this channel back to the RC radio."]
25380 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
25381 pub chan14_raw: u16,
25382 #[doc = "RC channel 15 value. A value of 0 or UINT16_MAX means to ignore this field. A value of UINT16_MAX-1 means to release this channel back to the RC radio."]
25383 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
25384 pub chan15_raw: u16,
25385 #[doc = "RC channel 16 value. A value of 0 or UINT16_MAX means to ignore this field. A value of UINT16_MAX-1 means to release this channel back to the RC radio."]
25386 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
25387 pub chan16_raw: u16,
25388 #[doc = "RC channel 17 value. A value of 0 or UINT16_MAX means to ignore this field. A value of UINT16_MAX-1 means to release this channel back to the RC radio."]
25389 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
25390 pub chan17_raw: u16,
25391 #[doc = "RC channel 18 value. A value of 0 or UINT16_MAX means to ignore this field. A value of UINT16_MAX-1 means to release this channel back to the RC radio."]
25392 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
25393 pub chan18_raw: u16,
25394}
25395impl RC_CHANNELS_OVERRIDE_DATA {
25396 pub const ENCODED_LEN: usize = 38usize;
25397 pub const DEFAULT: Self = Self {
25398 chan1_raw: 0_u16,
25399 chan2_raw: 0_u16,
25400 chan3_raw: 0_u16,
25401 chan4_raw: 0_u16,
25402 chan5_raw: 0_u16,
25403 chan6_raw: 0_u16,
25404 chan7_raw: 0_u16,
25405 chan8_raw: 0_u16,
25406 target_system: 0_u8,
25407 target_component: 0_u8,
25408 chan9_raw: 0_u16,
25409 chan10_raw: 0_u16,
25410 chan11_raw: 0_u16,
25411 chan12_raw: 0_u16,
25412 chan13_raw: 0_u16,
25413 chan14_raw: 0_u16,
25414 chan15_raw: 0_u16,
25415 chan16_raw: 0_u16,
25416 chan17_raw: 0_u16,
25417 chan18_raw: 0_u16,
25418 };
25419 #[cfg(feature = "arbitrary")]
25420 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
25421 use arbitrary::{Arbitrary, Unstructured};
25422 let mut buf = [0u8; 1024];
25423 rng.fill_bytes(&mut buf);
25424 let mut unstructured = Unstructured::new(&buf);
25425 Self::arbitrary(&mut unstructured).unwrap_or_default()
25426 }
25427}
25428impl Default for RC_CHANNELS_OVERRIDE_DATA {
25429 fn default() -> Self {
25430 Self::DEFAULT.clone()
25431 }
25432}
25433impl MessageData for RC_CHANNELS_OVERRIDE_DATA {
25434 type Message = MavMessage;
25435 const ID: u32 = 70u32;
25436 const NAME: &'static str = "RC_CHANNELS_OVERRIDE";
25437 const EXTRA_CRC: u8 = 124u8;
25438 const ENCODED_LEN: usize = 38usize;
25439 fn deser(
25440 _version: MavlinkVersion,
25441 __input: &[u8],
25442 ) -> Result<Self, ::mavlink_core::error::ParserError> {
25443 let avail_len = __input.len();
25444 let mut payload_buf = [0; Self::ENCODED_LEN];
25445 let mut buf = if avail_len < Self::ENCODED_LEN {
25446 payload_buf[0..avail_len].copy_from_slice(__input);
25447 Bytes::new(&payload_buf)
25448 } else {
25449 Bytes::new(__input)
25450 };
25451 let mut __struct = Self::default();
25452 __struct.chan1_raw = buf.get_u16_le();
25453 __struct.chan2_raw = buf.get_u16_le();
25454 __struct.chan3_raw = buf.get_u16_le();
25455 __struct.chan4_raw = buf.get_u16_le();
25456 __struct.chan5_raw = buf.get_u16_le();
25457 __struct.chan6_raw = buf.get_u16_le();
25458 __struct.chan7_raw = buf.get_u16_le();
25459 __struct.chan8_raw = buf.get_u16_le();
25460 __struct.target_system = buf.get_u8();
25461 __struct.target_component = buf.get_u8();
25462 __struct.chan9_raw = buf.get_u16_le();
25463 __struct.chan10_raw = buf.get_u16_le();
25464 __struct.chan11_raw = buf.get_u16_le();
25465 __struct.chan12_raw = buf.get_u16_le();
25466 __struct.chan13_raw = buf.get_u16_le();
25467 __struct.chan14_raw = buf.get_u16_le();
25468 __struct.chan15_raw = buf.get_u16_le();
25469 __struct.chan16_raw = buf.get_u16_le();
25470 __struct.chan17_raw = buf.get_u16_le();
25471 __struct.chan18_raw = buf.get_u16_le();
25472 Ok(__struct)
25473 }
25474 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
25475 let mut __tmp = BytesMut::new(bytes);
25476 #[allow(clippy::absurd_extreme_comparisons)]
25477 #[allow(unused_comparisons)]
25478 if __tmp.remaining() < Self::ENCODED_LEN {
25479 panic!(
25480 "buffer is too small (need {} bytes, but got {})",
25481 Self::ENCODED_LEN,
25482 __tmp.remaining(),
25483 )
25484 }
25485 __tmp.put_u16_le(self.chan1_raw);
25486 __tmp.put_u16_le(self.chan2_raw);
25487 __tmp.put_u16_le(self.chan3_raw);
25488 __tmp.put_u16_le(self.chan4_raw);
25489 __tmp.put_u16_le(self.chan5_raw);
25490 __tmp.put_u16_le(self.chan6_raw);
25491 __tmp.put_u16_le(self.chan7_raw);
25492 __tmp.put_u16_le(self.chan8_raw);
25493 __tmp.put_u8(self.target_system);
25494 __tmp.put_u8(self.target_component);
25495 if matches!(version, MavlinkVersion::V2) {
25496 __tmp.put_u16_le(self.chan9_raw);
25497 __tmp.put_u16_le(self.chan10_raw);
25498 __tmp.put_u16_le(self.chan11_raw);
25499 __tmp.put_u16_le(self.chan12_raw);
25500 __tmp.put_u16_le(self.chan13_raw);
25501 __tmp.put_u16_le(self.chan14_raw);
25502 __tmp.put_u16_le(self.chan15_raw);
25503 __tmp.put_u16_le(self.chan16_raw);
25504 __tmp.put_u16_le(self.chan17_raw);
25505 __tmp.put_u16_le(self.chan18_raw);
25506 let len = __tmp.len();
25507 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
25508 } else {
25509 __tmp.len()
25510 }
25511 }
25512}
25513#[doc = "The RAW values of the RC channels received. The standard PPM modulation is as follows: 1000 microseconds: 0%, 2000 microseconds: 100%. A value of UINT16_MAX implies the channel is unused. Individual receivers/transmitters might violate this specification."]
25514#[doc = ""]
25515#[doc = "ID: 35"]
25516#[derive(Debug, Clone, PartialEq)]
25517#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
25518#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
25519#[cfg_attr(feature = "ts", derive(TS))]
25520#[cfg_attr(feature = "ts", ts(export))]
25521pub struct RC_CHANNELS_RAW_DATA {
25522 #[doc = "Timestamp (time since system boot)."]
25523 pub time_boot_ms: u32,
25524 #[doc = "RC channel 1 value."]
25525 pub chan1_raw: u16,
25526 #[doc = "RC channel 2 value."]
25527 pub chan2_raw: u16,
25528 #[doc = "RC channel 3 value."]
25529 pub chan3_raw: u16,
25530 #[doc = "RC channel 4 value."]
25531 pub chan4_raw: u16,
25532 #[doc = "RC channel 5 value."]
25533 pub chan5_raw: u16,
25534 #[doc = "RC channel 6 value."]
25535 pub chan6_raw: u16,
25536 #[doc = "RC channel 7 value."]
25537 pub chan7_raw: u16,
25538 #[doc = "RC channel 8 value."]
25539 pub chan8_raw: u16,
25540 #[doc = "Servo output port (set of 8 outputs = 1 port). Flight stacks running on Pixhawk should use: 0 = MAIN, 1 = AUX."]
25541 pub port: u8,
25542 #[doc = "Receive signal strength indicator in device-dependent units/scale. Values: [0-254], UINT8_MAX: invalid/unknown."]
25543 pub rssi: u8,
25544}
25545impl RC_CHANNELS_RAW_DATA {
25546 pub const ENCODED_LEN: usize = 22usize;
25547 pub const DEFAULT: Self = Self {
25548 time_boot_ms: 0_u32,
25549 chan1_raw: 0_u16,
25550 chan2_raw: 0_u16,
25551 chan3_raw: 0_u16,
25552 chan4_raw: 0_u16,
25553 chan5_raw: 0_u16,
25554 chan6_raw: 0_u16,
25555 chan7_raw: 0_u16,
25556 chan8_raw: 0_u16,
25557 port: 0_u8,
25558 rssi: 0_u8,
25559 };
25560 #[cfg(feature = "arbitrary")]
25561 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
25562 use arbitrary::{Arbitrary, Unstructured};
25563 let mut buf = [0u8; 1024];
25564 rng.fill_bytes(&mut buf);
25565 let mut unstructured = Unstructured::new(&buf);
25566 Self::arbitrary(&mut unstructured).unwrap_or_default()
25567 }
25568}
25569impl Default for RC_CHANNELS_RAW_DATA {
25570 fn default() -> Self {
25571 Self::DEFAULT.clone()
25572 }
25573}
25574impl MessageData for RC_CHANNELS_RAW_DATA {
25575 type Message = MavMessage;
25576 const ID: u32 = 35u32;
25577 const NAME: &'static str = "RC_CHANNELS_RAW";
25578 const EXTRA_CRC: u8 = 244u8;
25579 const ENCODED_LEN: usize = 22usize;
25580 fn deser(
25581 _version: MavlinkVersion,
25582 __input: &[u8],
25583 ) -> Result<Self, ::mavlink_core::error::ParserError> {
25584 let avail_len = __input.len();
25585 let mut payload_buf = [0; Self::ENCODED_LEN];
25586 let mut buf = if avail_len < Self::ENCODED_LEN {
25587 payload_buf[0..avail_len].copy_from_slice(__input);
25588 Bytes::new(&payload_buf)
25589 } else {
25590 Bytes::new(__input)
25591 };
25592 let mut __struct = Self::default();
25593 __struct.time_boot_ms = buf.get_u32_le();
25594 __struct.chan1_raw = buf.get_u16_le();
25595 __struct.chan2_raw = buf.get_u16_le();
25596 __struct.chan3_raw = buf.get_u16_le();
25597 __struct.chan4_raw = buf.get_u16_le();
25598 __struct.chan5_raw = buf.get_u16_le();
25599 __struct.chan6_raw = buf.get_u16_le();
25600 __struct.chan7_raw = buf.get_u16_le();
25601 __struct.chan8_raw = buf.get_u16_le();
25602 __struct.port = buf.get_u8();
25603 __struct.rssi = buf.get_u8();
25604 Ok(__struct)
25605 }
25606 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
25607 let mut __tmp = BytesMut::new(bytes);
25608 #[allow(clippy::absurd_extreme_comparisons)]
25609 #[allow(unused_comparisons)]
25610 if __tmp.remaining() < Self::ENCODED_LEN {
25611 panic!(
25612 "buffer is too small (need {} bytes, but got {})",
25613 Self::ENCODED_LEN,
25614 __tmp.remaining(),
25615 )
25616 }
25617 __tmp.put_u32_le(self.time_boot_ms);
25618 __tmp.put_u16_le(self.chan1_raw);
25619 __tmp.put_u16_le(self.chan2_raw);
25620 __tmp.put_u16_le(self.chan3_raw);
25621 __tmp.put_u16_le(self.chan4_raw);
25622 __tmp.put_u16_le(self.chan5_raw);
25623 __tmp.put_u16_le(self.chan6_raw);
25624 __tmp.put_u16_le(self.chan7_raw);
25625 __tmp.put_u16_le(self.chan8_raw);
25626 __tmp.put_u8(self.port);
25627 __tmp.put_u8(self.rssi);
25628 if matches!(version, MavlinkVersion::V2) {
25629 let len = __tmp.len();
25630 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
25631 } else {
25632 __tmp.len()
25633 }
25634 }
25635}
25636#[doc = "The scaled values of the RC channels received: (-100%) -10000, (0%) 0, (100%) 10000. Channels that are inactive should be set to INT16_MAX."]
25637#[doc = ""]
25638#[doc = "ID: 34"]
25639#[derive(Debug, Clone, PartialEq)]
25640#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
25641#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
25642#[cfg_attr(feature = "ts", derive(TS))]
25643#[cfg_attr(feature = "ts", ts(export))]
25644pub struct RC_CHANNELS_SCALED_DATA {
25645 #[doc = "Timestamp (time since system boot)."]
25646 pub time_boot_ms: u32,
25647 #[doc = "RC channel 1 value scaled."]
25648 pub chan1_scaled: i16,
25649 #[doc = "RC channel 2 value scaled."]
25650 pub chan2_scaled: i16,
25651 #[doc = "RC channel 3 value scaled."]
25652 pub chan3_scaled: i16,
25653 #[doc = "RC channel 4 value scaled."]
25654 pub chan4_scaled: i16,
25655 #[doc = "RC channel 5 value scaled."]
25656 pub chan5_scaled: i16,
25657 #[doc = "RC channel 6 value scaled."]
25658 pub chan6_scaled: i16,
25659 #[doc = "RC channel 7 value scaled."]
25660 pub chan7_scaled: i16,
25661 #[doc = "RC channel 8 value scaled."]
25662 pub chan8_scaled: i16,
25663 #[doc = "Servo output port (set of 8 outputs = 1 port). Flight stacks running on Pixhawk should use: 0 = MAIN, 1 = AUX."]
25664 pub port: u8,
25665 #[doc = "Receive signal strength indicator in device-dependent units/scale. Values: [0-254], UINT8_MAX: invalid/unknown."]
25666 pub rssi: u8,
25667}
25668impl RC_CHANNELS_SCALED_DATA {
25669 pub const ENCODED_LEN: usize = 22usize;
25670 pub const DEFAULT: Self = Self {
25671 time_boot_ms: 0_u32,
25672 chan1_scaled: 0_i16,
25673 chan2_scaled: 0_i16,
25674 chan3_scaled: 0_i16,
25675 chan4_scaled: 0_i16,
25676 chan5_scaled: 0_i16,
25677 chan6_scaled: 0_i16,
25678 chan7_scaled: 0_i16,
25679 chan8_scaled: 0_i16,
25680 port: 0_u8,
25681 rssi: 0_u8,
25682 };
25683 #[cfg(feature = "arbitrary")]
25684 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
25685 use arbitrary::{Arbitrary, Unstructured};
25686 let mut buf = [0u8; 1024];
25687 rng.fill_bytes(&mut buf);
25688 let mut unstructured = Unstructured::new(&buf);
25689 Self::arbitrary(&mut unstructured).unwrap_or_default()
25690 }
25691}
25692impl Default for RC_CHANNELS_SCALED_DATA {
25693 fn default() -> Self {
25694 Self::DEFAULT.clone()
25695 }
25696}
25697impl MessageData for RC_CHANNELS_SCALED_DATA {
25698 type Message = MavMessage;
25699 const ID: u32 = 34u32;
25700 const NAME: &'static str = "RC_CHANNELS_SCALED";
25701 const EXTRA_CRC: u8 = 237u8;
25702 const ENCODED_LEN: usize = 22usize;
25703 fn deser(
25704 _version: MavlinkVersion,
25705 __input: &[u8],
25706 ) -> Result<Self, ::mavlink_core::error::ParserError> {
25707 let avail_len = __input.len();
25708 let mut payload_buf = [0; Self::ENCODED_LEN];
25709 let mut buf = if avail_len < Self::ENCODED_LEN {
25710 payload_buf[0..avail_len].copy_from_slice(__input);
25711 Bytes::new(&payload_buf)
25712 } else {
25713 Bytes::new(__input)
25714 };
25715 let mut __struct = Self::default();
25716 __struct.time_boot_ms = buf.get_u32_le();
25717 __struct.chan1_scaled = buf.get_i16_le();
25718 __struct.chan2_scaled = buf.get_i16_le();
25719 __struct.chan3_scaled = buf.get_i16_le();
25720 __struct.chan4_scaled = buf.get_i16_le();
25721 __struct.chan5_scaled = buf.get_i16_le();
25722 __struct.chan6_scaled = buf.get_i16_le();
25723 __struct.chan7_scaled = buf.get_i16_le();
25724 __struct.chan8_scaled = buf.get_i16_le();
25725 __struct.port = buf.get_u8();
25726 __struct.rssi = buf.get_u8();
25727 Ok(__struct)
25728 }
25729 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
25730 let mut __tmp = BytesMut::new(bytes);
25731 #[allow(clippy::absurd_extreme_comparisons)]
25732 #[allow(unused_comparisons)]
25733 if __tmp.remaining() < Self::ENCODED_LEN {
25734 panic!(
25735 "buffer is too small (need {} bytes, but got {})",
25736 Self::ENCODED_LEN,
25737 __tmp.remaining(),
25738 )
25739 }
25740 __tmp.put_u32_le(self.time_boot_ms);
25741 __tmp.put_i16_le(self.chan1_scaled);
25742 __tmp.put_i16_le(self.chan2_scaled);
25743 __tmp.put_i16_le(self.chan3_scaled);
25744 __tmp.put_i16_le(self.chan4_scaled);
25745 __tmp.put_i16_le(self.chan5_scaled);
25746 __tmp.put_i16_le(self.chan6_scaled);
25747 __tmp.put_i16_le(self.chan7_scaled);
25748 __tmp.put_i16_le(self.chan8_scaled);
25749 __tmp.put_u8(self.port);
25750 __tmp.put_u8(self.rssi);
25751 if matches!(version, MavlinkVersion::V2) {
25752 let len = __tmp.len();
25753 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
25754 } else {
25755 __tmp.len()
25756 }
25757 }
25758}
25759#[deprecated = " See `MAV_CMD_SET_MESSAGE_INTERVAL ` (Deprecated since 2015-08)"]
25760#[doc = "Request a data stream."]
25761#[doc = ""]
25762#[doc = "ID: 66"]
25763#[derive(Debug, Clone, PartialEq)]
25764#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
25765#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
25766#[cfg_attr(feature = "ts", derive(TS))]
25767#[cfg_attr(feature = "ts", ts(export))]
25768pub struct REQUEST_DATA_STREAM_DATA {
25769 #[doc = "The requested message rate"]
25770 pub req_message_rate: u16,
25771 #[doc = "The target requested to send the message stream."]
25772 pub target_system: u8,
25773 #[doc = "The target requested to send the message stream."]
25774 pub target_component: u8,
25775 #[doc = "The ID of the requested data stream"]
25776 pub req_stream_id: u8,
25777 #[doc = "1 to start sending, 0 to stop sending."]
25778 pub start_stop: u8,
25779}
25780impl REQUEST_DATA_STREAM_DATA {
25781 pub const ENCODED_LEN: usize = 6usize;
25782 pub const DEFAULT: Self = Self {
25783 req_message_rate: 0_u16,
25784 target_system: 0_u8,
25785 target_component: 0_u8,
25786 req_stream_id: 0_u8,
25787 start_stop: 0_u8,
25788 };
25789 #[cfg(feature = "arbitrary")]
25790 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
25791 use arbitrary::{Arbitrary, Unstructured};
25792 let mut buf = [0u8; 1024];
25793 rng.fill_bytes(&mut buf);
25794 let mut unstructured = Unstructured::new(&buf);
25795 Self::arbitrary(&mut unstructured).unwrap_or_default()
25796 }
25797}
25798impl Default for REQUEST_DATA_STREAM_DATA {
25799 fn default() -> Self {
25800 Self::DEFAULT.clone()
25801 }
25802}
25803impl MessageData for REQUEST_DATA_STREAM_DATA {
25804 type Message = MavMessage;
25805 const ID: u32 = 66u32;
25806 const NAME: &'static str = "REQUEST_DATA_STREAM";
25807 const EXTRA_CRC: u8 = 148u8;
25808 const ENCODED_LEN: usize = 6usize;
25809 fn deser(
25810 _version: MavlinkVersion,
25811 __input: &[u8],
25812 ) -> Result<Self, ::mavlink_core::error::ParserError> {
25813 let avail_len = __input.len();
25814 let mut payload_buf = [0; Self::ENCODED_LEN];
25815 let mut buf = if avail_len < Self::ENCODED_LEN {
25816 payload_buf[0..avail_len].copy_from_slice(__input);
25817 Bytes::new(&payload_buf)
25818 } else {
25819 Bytes::new(__input)
25820 };
25821 let mut __struct = Self::default();
25822 __struct.req_message_rate = buf.get_u16_le();
25823 __struct.target_system = buf.get_u8();
25824 __struct.target_component = buf.get_u8();
25825 __struct.req_stream_id = buf.get_u8();
25826 __struct.start_stop = buf.get_u8();
25827 Ok(__struct)
25828 }
25829 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
25830 let mut __tmp = BytesMut::new(bytes);
25831 #[allow(clippy::absurd_extreme_comparisons)]
25832 #[allow(unused_comparisons)]
25833 if __tmp.remaining() < Self::ENCODED_LEN {
25834 panic!(
25835 "buffer is too small (need {} bytes, but got {})",
25836 Self::ENCODED_LEN,
25837 __tmp.remaining(),
25838 )
25839 }
25840 __tmp.put_u16_le(self.req_message_rate);
25841 __tmp.put_u8(self.target_system);
25842 __tmp.put_u8(self.target_component);
25843 __tmp.put_u8(self.req_stream_id);
25844 __tmp.put_u8(self.start_stop);
25845 if matches!(version, MavlinkVersion::V2) {
25846 let len = __tmp.len();
25847 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
25848 } else {
25849 __tmp.len()
25850 }
25851 }
25852}
25853#[doc = "Request one or more events to be (re-)sent. If first_sequence==last_sequence, only a single event is requested. Note that first_sequence can be larger than last_sequence (because the sequence number can wrap). Each sequence will trigger an EVENT or EVENT_ERROR response."]
25854#[doc = ""]
25855#[doc = "ID: 412"]
25856#[derive(Debug, Clone, PartialEq)]
25857#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
25858#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
25859#[cfg_attr(feature = "ts", derive(TS))]
25860#[cfg_attr(feature = "ts", ts(export))]
25861pub struct REQUEST_EVENT_DATA {
25862 #[doc = "First sequence number of the requested event."]
25863 pub first_sequence: u16,
25864 #[doc = "Last sequence number of the requested event."]
25865 pub last_sequence: u16,
25866 #[doc = "System ID"]
25867 pub target_system: u8,
25868 #[doc = "Component ID"]
25869 pub target_component: u8,
25870}
25871impl REQUEST_EVENT_DATA {
25872 pub const ENCODED_LEN: usize = 6usize;
25873 pub const DEFAULT: Self = Self {
25874 first_sequence: 0_u16,
25875 last_sequence: 0_u16,
25876 target_system: 0_u8,
25877 target_component: 0_u8,
25878 };
25879 #[cfg(feature = "arbitrary")]
25880 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
25881 use arbitrary::{Arbitrary, Unstructured};
25882 let mut buf = [0u8; 1024];
25883 rng.fill_bytes(&mut buf);
25884 let mut unstructured = Unstructured::new(&buf);
25885 Self::arbitrary(&mut unstructured).unwrap_or_default()
25886 }
25887}
25888impl Default for REQUEST_EVENT_DATA {
25889 fn default() -> Self {
25890 Self::DEFAULT.clone()
25891 }
25892}
25893impl MessageData for REQUEST_EVENT_DATA {
25894 type Message = MavMessage;
25895 const ID: u32 = 412u32;
25896 const NAME: &'static str = "REQUEST_EVENT";
25897 const EXTRA_CRC: u8 = 33u8;
25898 const ENCODED_LEN: usize = 6usize;
25899 fn deser(
25900 _version: MavlinkVersion,
25901 __input: &[u8],
25902 ) -> Result<Self, ::mavlink_core::error::ParserError> {
25903 let avail_len = __input.len();
25904 let mut payload_buf = [0; Self::ENCODED_LEN];
25905 let mut buf = if avail_len < Self::ENCODED_LEN {
25906 payload_buf[0..avail_len].copy_from_slice(__input);
25907 Bytes::new(&payload_buf)
25908 } else {
25909 Bytes::new(__input)
25910 };
25911 let mut __struct = Self::default();
25912 __struct.first_sequence = buf.get_u16_le();
25913 __struct.last_sequence = buf.get_u16_le();
25914 __struct.target_system = buf.get_u8();
25915 __struct.target_component = buf.get_u8();
25916 Ok(__struct)
25917 }
25918 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
25919 let mut __tmp = BytesMut::new(bytes);
25920 #[allow(clippy::absurd_extreme_comparisons)]
25921 #[allow(unused_comparisons)]
25922 if __tmp.remaining() < Self::ENCODED_LEN {
25923 panic!(
25924 "buffer is too small (need {} bytes, but got {})",
25925 Self::ENCODED_LEN,
25926 __tmp.remaining(),
25927 )
25928 }
25929 __tmp.put_u16_le(self.first_sequence);
25930 __tmp.put_u16_le(self.last_sequence);
25931 __tmp.put_u8(self.target_system);
25932 __tmp.put_u8(self.target_component);
25933 if matches!(version, MavlinkVersion::V2) {
25934 let len = __tmp.len();
25935 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
25936 } else {
25937 __tmp.len()
25938 }
25939 }
25940}
25941#[doc = "The autopilot is requesting a resource (file, binary, other type of data)."]
25942#[doc = ""]
25943#[doc = "ID: 142"]
25944#[derive(Debug, Clone, PartialEq)]
25945#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
25946#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
25947#[cfg_attr(feature = "ts", derive(TS))]
25948#[cfg_attr(feature = "ts", ts(export))]
25949pub struct RESOURCE_REQUEST_DATA {
25950 #[doc = "Request ID. This ID should be re-used when sending back URI contents"]
25951 pub request_id: u8,
25952 #[doc = "The type of requested URI. 0 = a file via URL. 1 = a UAVCAN binary"]
25953 pub uri_type: u8,
25954 #[doc = "The requested unique resource identifier (URI). It is not necessarily a straight domain name (depends on the URI type enum)"]
25955 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
25956 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
25957 pub uri: [u8; 120],
25958 #[doc = "The way the autopilot wants to receive the URI. 0 = MAVLink FTP. 1 = binary stream."]
25959 pub transfer_type: u8,
25960 #[doc = "The storage path the autopilot wants the URI to be stored in. Will only be valid if the transfer_type has a storage associated (e.g. MAVLink FTP)."]
25961 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
25962 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
25963 pub storage: [u8; 120],
25964}
25965impl RESOURCE_REQUEST_DATA {
25966 pub const ENCODED_LEN: usize = 243usize;
25967 pub const DEFAULT: Self = Self {
25968 request_id: 0_u8,
25969 uri_type: 0_u8,
25970 uri: [0_u8; 120usize],
25971 transfer_type: 0_u8,
25972 storage: [0_u8; 120usize],
25973 };
25974 #[cfg(feature = "arbitrary")]
25975 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
25976 use arbitrary::{Arbitrary, Unstructured};
25977 let mut buf = [0u8; 1024];
25978 rng.fill_bytes(&mut buf);
25979 let mut unstructured = Unstructured::new(&buf);
25980 Self::arbitrary(&mut unstructured).unwrap_or_default()
25981 }
25982}
25983impl Default for RESOURCE_REQUEST_DATA {
25984 fn default() -> Self {
25985 Self::DEFAULT.clone()
25986 }
25987}
25988impl MessageData for RESOURCE_REQUEST_DATA {
25989 type Message = MavMessage;
25990 const ID: u32 = 142u32;
25991 const NAME: &'static str = "RESOURCE_REQUEST";
25992 const EXTRA_CRC: u8 = 72u8;
25993 const ENCODED_LEN: usize = 243usize;
25994 fn deser(
25995 _version: MavlinkVersion,
25996 __input: &[u8],
25997 ) -> Result<Self, ::mavlink_core::error::ParserError> {
25998 let avail_len = __input.len();
25999 let mut payload_buf = [0; Self::ENCODED_LEN];
26000 let mut buf = if avail_len < Self::ENCODED_LEN {
26001 payload_buf[0..avail_len].copy_from_slice(__input);
26002 Bytes::new(&payload_buf)
26003 } else {
26004 Bytes::new(__input)
26005 };
26006 let mut __struct = Self::default();
26007 __struct.request_id = buf.get_u8();
26008 __struct.uri_type = buf.get_u8();
26009 for v in &mut __struct.uri {
26010 let val = buf.get_u8();
26011 *v = val;
26012 }
26013 __struct.transfer_type = buf.get_u8();
26014 for v in &mut __struct.storage {
26015 let val = buf.get_u8();
26016 *v = val;
26017 }
26018 Ok(__struct)
26019 }
26020 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
26021 let mut __tmp = BytesMut::new(bytes);
26022 #[allow(clippy::absurd_extreme_comparisons)]
26023 #[allow(unused_comparisons)]
26024 if __tmp.remaining() < Self::ENCODED_LEN {
26025 panic!(
26026 "buffer is too small (need {} bytes, but got {})",
26027 Self::ENCODED_LEN,
26028 __tmp.remaining(),
26029 )
26030 }
26031 __tmp.put_u8(self.request_id);
26032 __tmp.put_u8(self.uri_type);
26033 for val in &self.uri {
26034 __tmp.put_u8(*val);
26035 }
26036 __tmp.put_u8(self.transfer_type);
26037 for val in &self.storage {
26038 __tmp.put_u8(*val);
26039 }
26040 if matches!(version, MavlinkVersion::V2) {
26041 let len = __tmp.len();
26042 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
26043 } else {
26044 __tmp.len()
26045 }
26046 }
26047}
26048#[doc = "Response to a REQUEST_EVENT in case of an error (e.g. the event is not available anymore)."]
26049#[doc = ""]
26050#[doc = "ID: 413"]
26051#[derive(Debug, Clone, PartialEq)]
26052#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
26053#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
26054#[cfg_attr(feature = "ts", derive(TS))]
26055#[cfg_attr(feature = "ts", ts(export))]
26056pub struct RESPONSE_EVENT_ERROR_DATA {
26057 #[doc = "Sequence number."]
26058 pub sequence: u16,
26059 #[doc = "Oldest Sequence number that is still available after the sequence set in REQUEST_EVENT."]
26060 pub sequence_oldest_available: u16,
26061 #[doc = "System ID"]
26062 pub target_system: u8,
26063 #[doc = "Component ID"]
26064 pub target_component: u8,
26065 #[doc = "Error reason."]
26066 pub reason: MavEventErrorReason,
26067}
26068impl RESPONSE_EVENT_ERROR_DATA {
26069 pub const ENCODED_LEN: usize = 7usize;
26070 pub const DEFAULT: Self = Self {
26071 sequence: 0_u16,
26072 sequence_oldest_available: 0_u16,
26073 target_system: 0_u8,
26074 target_component: 0_u8,
26075 reason: MavEventErrorReason::DEFAULT,
26076 };
26077 #[cfg(feature = "arbitrary")]
26078 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
26079 use arbitrary::{Arbitrary, Unstructured};
26080 let mut buf = [0u8; 1024];
26081 rng.fill_bytes(&mut buf);
26082 let mut unstructured = Unstructured::new(&buf);
26083 Self::arbitrary(&mut unstructured).unwrap_or_default()
26084 }
26085}
26086impl Default for RESPONSE_EVENT_ERROR_DATA {
26087 fn default() -> Self {
26088 Self::DEFAULT.clone()
26089 }
26090}
26091impl MessageData for RESPONSE_EVENT_ERROR_DATA {
26092 type Message = MavMessage;
26093 const ID: u32 = 413u32;
26094 const NAME: &'static str = "RESPONSE_EVENT_ERROR";
26095 const EXTRA_CRC: u8 = 77u8;
26096 const ENCODED_LEN: usize = 7usize;
26097 fn deser(
26098 _version: MavlinkVersion,
26099 __input: &[u8],
26100 ) -> Result<Self, ::mavlink_core::error::ParserError> {
26101 let avail_len = __input.len();
26102 let mut payload_buf = [0; Self::ENCODED_LEN];
26103 let mut buf = if avail_len < Self::ENCODED_LEN {
26104 payload_buf[0..avail_len].copy_from_slice(__input);
26105 Bytes::new(&payload_buf)
26106 } else {
26107 Bytes::new(__input)
26108 };
26109 let mut __struct = Self::default();
26110 __struct.sequence = buf.get_u16_le();
26111 __struct.sequence_oldest_available = buf.get_u16_le();
26112 __struct.target_system = buf.get_u8();
26113 __struct.target_component = buf.get_u8();
26114 let tmp = buf.get_u8();
26115 __struct.reason =
26116 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
26117 enum_type: "MavEventErrorReason",
26118 value: tmp as u64,
26119 })?;
26120 Ok(__struct)
26121 }
26122 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
26123 let mut __tmp = BytesMut::new(bytes);
26124 #[allow(clippy::absurd_extreme_comparisons)]
26125 #[allow(unused_comparisons)]
26126 if __tmp.remaining() < Self::ENCODED_LEN {
26127 panic!(
26128 "buffer is too small (need {} bytes, but got {})",
26129 Self::ENCODED_LEN,
26130 __tmp.remaining(),
26131 )
26132 }
26133 __tmp.put_u16_le(self.sequence);
26134 __tmp.put_u16_le(self.sequence_oldest_available);
26135 __tmp.put_u8(self.target_system);
26136 __tmp.put_u8(self.target_component);
26137 __tmp.put_u8(self.reason as u8);
26138 if matches!(version, MavlinkVersion::V2) {
26139 let len = __tmp.len();
26140 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
26141 } else {
26142 __tmp.len()
26143 }
26144 }
26145}
26146#[doc = "Read out the safety zone the MAV currently assumes."]
26147#[doc = ""]
26148#[doc = "ID: 55"]
26149#[derive(Debug, Clone, PartialEq)]
26150#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
26151#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
26152#[cfg_attr(feature = "ts", derive(TS))]
26153#[cfg_attr(feature = "ts", ts(export))]
26154pub struct SAFETY_ALLOWED_AREA_DATA {
26155 #[doc = "x position 1 / Latitude 1"]
26156 pub p1x: f32,
26157 #[doc = "y position 1 / Longitude 1"]
26158 pub p1y: f32,
26159 #[doc = "z position 1 / Altitude 1"]
26160 pub p1z: f32,
26161 #[doc = "x position 2 / Latitude 2"]
26162 pub p2x: f32,
26163 #[doc = "y position 2 / Longitude 2"]
26164 pub p2y: f32,
26165 #[doc = "z position 2 / Altitude 2"]
26166 pub p2z: f32,
26167 #[doc = "Coordinate frame. Can be either global, GPS, right-handed with Z axis up or local, right handed, Z axis down."]
26168 pub frame: MavFrame,
26169}
26170impl SAFETY_ALLOWED_AREA_DATA {
26171 pub const ENCODED_LEN: usize = 25usize;
26172 pub const DEFAULT: Self = Self {
26173 p1x: 0.0_f32,
26174 p1y: 0.0_f32,
26175 p1z: 0.0_f32,
26176 p2x: 0.0_f32,
26177 p2y: 0.0_f32,
26178 p2z: 0.0_f32,
26179 frame: MavFrame::DEFAULT,
26180 };
26181 #[cfg(feature = "arbitrary")]
26182 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
26183 use arbitrary::{Arbitrary, Unstructured};
26184 let mut buf = [0u8; 1024];
26185 rng.fill_bytes(&mut buf);
26186 let mut unstructured = Unstructured::new(&buf);
26187 Self::arbitrary(&mut unstructured).unwrap_or_default()
26188 }
26189}
26190impl Default for SAFETY_ALLOWED_AREA_DATA {
26191 fn default() -> Self {
26192 Self::DEFAULT.clone()
26193 }
26194}
26195impl MessageData for SAFETY_ALLOWED_AREA_DATA {
26196 type Message = MavMessage;
26197 const ID: u32 = 55u32;
26198 const NAME: &'static str = "SAFETY_ALLOWED_AREA";
26199 const EXTRA_CRC: u8 = 3u8;
26200 const ENCODED_LEN: usize = 25usize;
26201 fn deser(
26202 _version: MavlinkVersion,
26203 __input: &[u8],
26204 ) -> Result<Self, ::mavlink_core::error::ParserError> {
26205 let avail_len = __input.len();
26206 let mut payload_buf = [0; Self::ENCODED_LEN];
26207 let mut buf = if avail_len < Self::ENCODED_LEN {
26208 payload_buf[0..avail_len].copy_from_slice(__input);
26209 Bytes::new(&payload_buf)
26210 } else {
26211 Bytes::new(__input)
26212 };
26213 let mut __struct = Self::default();
26214 __struct.p1x = buf.get_f32_le();
26215 __struct.p1y = buf.get_f32_le();
26216 __struct.p1z = buf.get_f32_le();
26217 __struct.p2x = buf.get_f32_le();
26218 __struct.p2y = buf.get_f32_le();
26219 __struct.p2z = buf.get_f32_le();
26220 let tmp = buf.get_u8();
26221 __struct.frame =
26222 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
26223 enum_type: "MavFrame",
26224 value: tmp as u64,
26225 })?;
26226 Ok(__struct)
26227 }
26228 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
26229 let mut __tmp = BytesMut::new(bytes);
26230 #[allow(clippy::absurd_extreme_comparisons)]
26231 #[allow(unused_comparisons)]
26232 if __tmp.remaining() < Self::ENCODED_LEN {
26233 panic!(
26234 "buffer is too small (need {} bytes, but got {})",
26235 Self::ENCODED_LEN,
26236 __tmp.remaining(),
26237 )
26238 }
26239 __tmp.put_f32_le(self.p1x);
26240 __tmp.put_f32_le(self.p1y);
26241 __tmp.put_f32_le(self.p1z);
26242 __tmp.put_f32_le(self.p2x);
26243 __tmp.put_f32_le(self.p2y);
26244 __tmp.put_f32_le(self.p2z);
26245 __tmp.put_u8(self.frame as u8);
26246 if matches!(version, MavlinkVersion::V2) {
26247 let len = __tmp.len();
26248 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
26249 } else {
26250 __tmp.len()
26251 }
26252 }
26253}
26254#[doc = "Set a safety zone (volume), which is defined by two corners of a cube. This message can be used to tell the MAV which setpoints/waypoints to accept and which to reject. Safety areas are often enforced by national or competition regulations."]
26255#[doc = ""]
26256#[doc = "ID: 54"]
26257#[derive(Debug, Clone, PartialEq)]
26258#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
26259#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
26260#[cfg_attr(feature = "ts", derive(TS))]
26261#[cfg_attr(feature = "ts", ts(export))]
26262pub struct SAFETY_SET_ALLOWED_AREA_DATA {
26263 #[doc = "x position 1 / Latitude 1"]
26264 pub p1x: f32,
26265 #[doc = "y position 1 / Longitude 1"]
26266 pub p1y: f32,
26267 #[doc = "z position 1 / Altitude 1"]
26268 pub p1z: f32,
26269 #[doc = "x position 2 / Latitude 2"]
26270 pub p2x: f32,
26271 #[doc = "y position 2 / Longitude 2"]
26272 pub p2y: f32,
26273 #[doc = "z position 2 / Altitude 2"]
26274 pub p2z: f32,
26275 #[doc = "System ID"]
26276 pub target_system: u8,
26277 #[doc = "Component ID"]
26278 pub target_component: u8,
26279 #[doc = "Coordinate frame. Can be either global, GPS, right-handed with Z axis up or local, right handed, Z axis down."]
26280 pub frame: MavFrame,
26281}
26282impl SAFETY_SET_ALLOWED_AREA_DATA {
26283 pub const ENCODED_LEN: usize = 27usize;
26284 pub const DEFAULT: Self = Self {
26285 p1x: 0.0_f32,
26286 p1y: 0.0_f32,
26287 p1z: 0.0_f32,
26288 p2x: 0.0_f32,
26289 p2y: 0.0_f32,
26290 p2z: 0.0_f32,
26291 target_system: 0_u8,
26292 target_component: 0_u8,
26293 frame: MavFrame::DEFAULT,
26294 };
26295 #[cfg(feature = "arbitrary")]
26296 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
26297 use arbitrary::{Arbitrary, Unstructured};
26298 let mut buf = [0u8; 1024];
26299 rng.fill_bytes(&mut buf);
26300 let mut unstructured = Unstructured::new(&buf);
26301 Self::arbitrary(&mut unstructured).unwrap_or_default()
26302 }
26303}
26304impl Default for SAFETY_SET_ALLOWED_AREA_DATA {
26305 fn default() -> Self {
26306 Self::DEFAULT.clone()
26307 }
26308}
26309impl MessageData for SAFETY_SET_ALLOWED_AREA_DATA {
26310 type Message = MavMessage;
26311 const ID: u32 = 54u32;
26312 const NAME: &'static str = "SAFETY_SET_ALLOWED_AREA";
26313 const EXTRA_CRC: u8 = 15u8;
26314 const ENCODED_LEN: usize = 27usize;
26315 fn deser(
26316 _version: MavlinkVersion,
26317 __input: &[u8],
26318 ) -> Result<Self, ::mavlink_core::error::ParserError> {
26319 let avail_len = __input.len();
26320 let mut payload_buf = [0; Self::ENCODED_LEN];
26321 let mut buf = if avail_len < Self::ENCODED_LEN {
26322 payload_buf[0..avail_len].copy_from_slice(__input);
26323 Bytes::new(&payload_buf)
26324 } else {
26325 Bytes::new(__input)
26326 };
26327 let mut __struct = Self::default();
26328 __struct.p1x = buf.get_f32_le();
26329 __struct.p1y = buf.get_f32_le();
26330 __struct.p1z = buf.get_f32_le();
26331 __struct.p2x = buf.get_f32_le();
26332 __struct.p2y = buf.get_f32_le();
26333 __struct.p2z = buf.get_f32_le();
26334 __struct.target_system = buf.get_u8();
26335 __struct.target_component = buf.get_u8();
26336 let tmp = buf.get_u8();
26337 __struct.frame =
26338 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
26339 enum_type: "MavFrame",
26340 value: tmp as u64,
26341 })?;
26342 Ok(__struct)
26343 }
26344 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
26345 let mut __tmp = BytesMut::new(bytes);
26346 #[allow(clippy::absurd_extreme_comparisons)]
26347 #[allow(unused_comparisons)]
26348 if __tmp.remaining() < Self::ENCODED_LEN {
26349 panic!(
26350 "buffer is too small (need {} bytes, but got {})",
26351 Self::ENCODED_LEN,
26352 __tmp.remaining(),
26353 )
26354 }
26355 __tmp.put_f32_le(self.p1x);
26356 __tmp.put_f32_le(self.p1y);
26357 __tmp.put_f32_le(self.p1z);
26358 __tmp.put_f32_le(self.p2x);
26359 __tmp.put_f32_le(self.p2y);
26360 __tmp.put_f32_le(self.p2z);
26361 __tmp.put_u8(self.target_system);
26362 __tmp.put_u8(self.target_component);
26363 __tmp.put_u8(self.frame as u8);
26364 if matches!(version, MavlinkVersion::V2) {
26365 let len = __tmp.len();
26366 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
26367 } else {
26368 __tmp.len()
26369 }
26370 }
26371}
26372#[doc = "The RAW IMU readings for the usual 9DOF sensor setup. This message should contain the scaled values to the described units."]
26373#[doc = ""]
26374#[doc = "ID: 26"]
26375#[derive(Debug, Clone, PartialEq)]
26376#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
26377#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
26378#[cfg_attr(feature = "ts", derive(TS))]
26379#[cfg_attr(feature = "ts", ts(export))]
26380pub struct SCALED_IMU_DATA {
26381 #[doc = "Timestamp (time since system boot)."]
26382 pub time_boot_ms: u32,
26383 #[doc = "X acceleration"]
26384 pub xacc: i16,
26385 #[doc = "Y acceleration"]
26386 pub yacc: i16,
26387 #[doc = "Z acceleration"]
26388 pub zacc: i16,
26389 #[doc = "Angular speed around X axis"]
26390 pub xgyro: i16,
26391 #[doc = "Angular speed around Y axis"]
26392 pub ygyro: i16,
26393 #[doc = "Angular speed around Z axis"]
26394 pub zgyro: i16,
26395 #[doc = "X Magnetic field"]
26396 pub xmag: i16,
26397 #[doc = "Y Magnetic field"]
26398 pub ymag: i16,
26399 #[doc = "Z Magnetic field"]
26400 pub zmag: i16,
26401 #[doc = "Temperature, 0: IMU does not provide temperature values. If the IMU is at 0C it must send 1 (0.01C)."]
26402 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
26403 pub temperature: i16,
26404}
26405impl SCALED_IMU_DATA {
26406 pub const ENCODED_LEN: usize = 24usize;
26407 pub const DEFAULT: Self = Self {
26408 time_boot_ms: 0_u32,
26409 xacc: 0_i16,
26410 yacc: 0_i16,
26411 zacc: 0_i16,
26412 xgyro: 0_i16,
26413 ygyro: 0_i16,
26414 zgyro: 0_i16,
26415 xmag: 0_i16,
26416 ymag: 0_i16,
26417 zmag: 0_i16,
26418 temperature: 0_i16,
26419 };
26420 #[cfg(feature = "arbitrary")]
26421 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
26422 use arbitrary::{Arbitrary, Unstructured};
26423 let mut buf = [0u8; 1024];
26424 rng.fill_bytes(&mut buf);
26425 let mut unstructured = Unstructured::new(&buf);
26426 Self::arbitrary(&mut unstructured).unwrap_or_default()
26427 }
26428}
26429impl Default for SCALED_IMU_DATA {
26430 fn default() -> Self {
26431 Self::DEFAULT.clone()
26432 }
26433}
26434impl MessageData for SCALED_IMU_DATA {
26435 type Message = MavMessage;
26436 const ID: u32 = 26u32;
26437 const NAME: &'static str = "SCALED_IMU";
26438 const EXTRA_CRC: u8 = 170u8;
26439 const ENCODED_LEN: usize = 24usize;
26440 fn deser(
26441 _version: MavlinkVersion,
26442 __input: &[u8],
26443 ) -> Result<Self, ::mavlink_core::error::ParserError> {
26444 let avail_len = __input.len();
26445 let mut payload_buf = [0; Self::ENCODED_LEN];
26446 let mut buf = if avail_len < Self::ENCODED_LEN {
26447 payload_buf[0..avail_len].copy_from_slice(__input);
26448 Bytes::new(&payload_buf)
26449 } else {
26450 Bytes::new(__input)
26451 };
26452 let mut __struct = Self::default();
26453 __struct.time_boot_ms = buf.get_u32_le();
26454 __struct.xacc = buf.get_i16_le();
26455 __struct.yacc = buf.get_i16_le();
26456 __struct.zacc = buf.get_i16_le();
26457 __struct.xgyro = buf.get_i16_le();
26458 __struct.ygyro = buf.get_i16_le();
26459 __struct.zgyro = buf.get_i16_le();
26460 __struct.xmag = buf.get_i16_le();
26461 __struct.ymag = buf.get_i16_le();
26462 __struct.zmag = buf.get_i16_le();
26463 __struct.temperature = buf.get_i16_le();
26464 Ok(__struct)
26465 }
26466 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
26467 let mut __tmp = BytesMut::new(bytes);
26468 #[allow(clippy::absurd_extreme_comparisons)]
26469 #[allow(unused_comparisons)]
26470 if __tmp.remaining() < Self::ENCODED_LEN {
26471 panic!(
26472 "buffer is too small (need {} bytes, but got {})",
26473 Self::ENCODED_LEN,
26474 __tmp.remaining(),
26475 )
26476 }
26477 __tmp.put_u32_le(self.time_boot_ms);
26478 __tmp.put_i16_le(self.xacc);
26479 __tmp.put_i16_le(self.yacc);
26480 __tmp.put_i16_le(self.zacc);
26481 __tmp.put_i16_le(self.xgyro);
26482 __tmp.put_i16_le(self.ygyro);
26483 __tmp.put_i16_le(self.zgyro);
26484 __tmp.put_i16_le(self.xmag);
26485 __tmp.put_i16_le(self.ymag);
26486 __tmp.put_i16_le(self.zmag);
26487 if matches!(version, MavlinkVersion::V2) {
26488 __tmp.put_i16_le(self.temperature);
26489 let len = __tmp.len();
26490 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
26491 } else {
26492 __tmp.len()
26493 }
26494 }
26495}
26496#[doc = "The RAW IMU readings for secondary 9DOF sensor setup. This message should contain the scaled values to the described units."]
26497#[doc = ""]
26498#[doc = "ID: 116"]
26499#[derive(Debug, Clone, PartialEq)]
26500#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
26501#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
26502#[cfg_attr(feature = "ts", derive(TS))]
26503#[cfg_attr(feature = "ts", ts(export))]
26504pub struct SCALED_IMU2_DATA {
26505 #[doc = "Timestamp (time since system boot)."]
26506 pub time_boot_ms: u32,
26507 #[doc = "X acceleration"]
26508 pub xacc: i16,
26509 #[doc = "Y acceleration"]
26510 pub yacc: i16,
26511 #[doc = "Z acceleration"]
26512 pub zacc: i16,
26513 #[doc = "Angular speed around X axis"]
26514 pub xgyro: i16,
26515 #[doc = "Angular speed around Y axis"]
26516 pub ygyro: i16,
26517 #[doc = "Angular speed around Z axis"]
26518 pub zgyro: i16,
26519 #[doc = "X Magnetic field"]
26520 pub xmag: i16,
26521 #[doc = "Y Magnetic field"]
26522 pub ymag: i16,
26523 #[doc = "Z Magnetic field"]
26524 pub zmag: i16,
26525 #[doc = "Temperature, 0: IMU does not provide temperature values. If the IMU is at 0C it must send 1 (0.01C)."]
26526 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
26527 pub temperature: i16,
26528}
26529impl SCALED_IMU2_DATA {
26530 pub const ENCODED_LEN: usize = 24usize;
26531 pub const DEFAULT: Self = Self {
26532 time_boot_ms: 0_u32,
26533 xacc: 0_i16,
26534 yacc: 0_i16,
26535 zacc: 0_i16,
26536 xgyro: 0_i16,
26537 ygyro: 0_i16,
26538 zgyro: 0_i16,
26539 xmag: 0_i16,
26540 ymag: 0_i16,
26541 zmag: 0_i16,
26542 temperature: 0_i16,
26543 };
26544 #[cfg(feature = "arbitrary")]
26545 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
26546 use arbitrary::{Arbitrary, Unstructured};
26547 let mut buf = [0u8; 1024];
26548 rng.fill_bytes(&mut buf);
26549 let mut unstructured = Unstructured::new(&buf);
26550 Self::arbitrary(&mut unstructured).unwrap_or_default()
26551 }
26552}
26553impl Default for SCALED_IMU2_DATA {
26554 fn default() -> Self {
26555 Self::DEFAULT.clone()
26556 }
26557}
26558impl MessageData for SCALED_IMU2_DATA {
26559 type Message = MavMessage;
26560 const ID: u32 = 116u32;
26561 const NAME: &'static str = "SCALED_IMU2";
26562 const EXTRA_CRC: u8 = 76u8;
26563 const ENCODED_LEN: usize = 24usize;
26564 fn deser(
26565 _version: MavlinkVersion,
26566 __input: &[u8],
26567 ) -> Result<Self, ::mavlink_core::error::ParserError> {
26568 let avail_len = __input.len();
26569 let mut payload_buf = [0; Self::ENCODED_LEN];
26570 let mut buf = if avail_len < Self::ENCODED_LEN {
26571 payload_buf[0..avail_len].copy_from_slice(__input);
26572 Bytes::new(&payload_buf)
26573 } else {
26574 Bytes::new(__input)
26575 };
26576 let mut __struct = Self::default();
26577 __struct.time_boot_ms = buf.get_u32_le();
26578 __struct.xacc = buf.get_i16_le();
26579 __struct.yacc = buf.get_i16_le();
26580 __struct.zacc = buf.get_i16_le();
26581 __struct.xgyro = buf.get_i16_le();
26582 __struct.ygyro = buf.get_i16_le();
26583 __struct.zgyro = buf.get_i16_le();
26584 __struct.xmag = buf.get_i16_le();
26585 __struct.ymag = buf.get_i16_le();
26586 __struct.zmag = buf.get_i16_le();
26587 __struct.temperature = buf.get_i16_le();
26588 Ok(__struct)
26589 }
26590 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
26591 let mut __tmp = BytesMut::new(bytes);
26592 #[allow(clippy::absurd_extreme_comparisons)]
26593 #[allow(unused_comparisons)]
26594 if __tmp.remaining() < Self::ENCODED_LEN {
26595 panic!(
26596 "buffer is too small (need {} bytes, but got {})",
26597 Self::ENCODED_LEN,
26598 __tmp.remaining(),
26599 )
26600 }
26601 __tmp.put_u32_le(self.time_boot_ms);
26602 __tmp.put_i16_le(self.xacc);
26603 __tmp.put_i16_le(self.yacc);
26604 __tmp.put_i16_le(self.zacc);
26605 __tmp.put_i16_le(self.xgyro);
26606 __tmp.put_i16_le(self.ygyro);
26607 __tmp.put_i16_le(self.zgyro);
26608 __tmp.put_i16_le(self.xmag);
26609 __tmp.put_i16_le(self.ymag);
26610 __tmp.put_i16_le(self.zmag);
26611 if matches!(version, MavlinkVersion::V2) {
26612 __tmp.put_i16_le(self.temperature);
26613 let len = __tmp.len();
26614 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
26615 } else {
26616 __tmp.len()
26617 }
26618 }
26619}
26620#[doc = "The RAW IMU readings for 3rd 9DOF sensor setup. This message should contain the scaled values to the described units."]
26621#[doc = ""]
26622#[doc = "ID: 129"]
26623#[derive(Debug, Clone, PartialEq)]
26624#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
26625#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
26626#[cfg_attr(feature = "ts", derive(TS))]
26627#[cfg_attr(feature = "ts", ts(export))]
26628pub struct SCALED_IMU3_DATA {
26629 #[doc = "Timestamp (time since system boot)."]
26630 pub time_boot_ms: u32,
26631 #[doc = "X acceleration"]
26632 pub xacc: i16,
26633 #[doc = "Y acceleration"]
26634 pub yacc: i16,
26635 #[doc = "Z acceleration"]
26636 pub zacc: i16,
26637 #[doc = "Angular speed around X axis"]
26638 pub xgyro: i16,
26639 #[doc = "Angular speed around Y axis"]
26640 pub ygyro: i16,
26641 #[doc = "Angular speed around Z axis"]
26642 pub zgyro: i16,
26643 #[doc = "X Magnetic field"]
26644 pub xmag: i16,
26645 #[doc = "Y Magnetic field"]
26646 pub ymag: i16,
26647 #[doc = "Z Magnetic field"]
26648 pub zmag: i16,
26649 #[doc = "Temperature, 0: IMU does not provide temperature values. If the IMU is at 0C it must send 1 (0.01C)."]
26650 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
26651 pub temperature: i16,
26652}
26653impl SCALED_IMU3_DATA {
26654 pub const ENCODED_LEN: usize = 24usize;
26655 pub const DEFAULT: Self = Self {
26656 time_boot_ms: 0_u32,
26657 xacc: 0_i16,
26658 yacc: 0_i16,
26659 zacc: 0_i16,
26660 xgyro: 0_i16,
26661 ygyro: 0_i16,
26662 zgyro: 0_i16,
26663 xmag: 0_i16,
26664 ymag: 0_i16,
26665 zmag: 0_i16,
26666 temperature: 0_i16,
26667 };
26668 #[cfg(feature = "arbitrary")]
26669 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
26670 use arbitrary::{Arbitrary, Unstructured};
26671 let mut buf = [0u8; 1024];
26672 rng.fill_bytes(&mut buf);
26673 let mut unstructured = Unstructured::new(&buf);
26674 Self::arbitrary(&mut unstructured).unwrap_or_default()
26675 }
26676}
26677impl Default for SCALED_IMU3_DATA {
26678 fn default() -> Self {
26679 Self::DEFAULT.clone()
26680 }
26681}
26682impl MessageData for SCALED_IMU3_DATA {
26683 type Message = MavMessage;
26684 const ID: u32 = 129u32;
26685 const NAME: &'static str = "SCALED_IMU3";
26686 const EXTRA_CRC: u8 = 46u8;
26687 const ENCODED_LEN: usize = 24usize;
26688 fn deser(
26689 _version: MavlinkVersion,
26690 __input: &[u8],
26691 ) -> Result<Self, ::mavlink_core::error::ParserError> {
26692 let avail_len = __input.len();
26693 let mut payload_buf = [0; Self::ENCODED_LEN];
26694 let mut buf = if avail_len < Self::ENCODED_LEN {
26695 payload_buf[0..avail_len].copy_from_slice(__input);
26696 Bytes::new(&payload_buf)
26697 } else {
26698 Bytes::new(__input)
26699 };
26700 let mut __struct = Self::default();
26701 __struct.time_boot_ms = buf.get_u32_le();
26702 __struct.xacc = buf.get_i16_le();
26703 __struct.yacc = buf.get_i16_le();
26704 __struct.zacc = buf.get_i16_le();
26705 __struct.xgyro = buf.get_i16_le();
26706 __struct.ygyro = buf.get_i16_le();
26707 __struct.zgyro = buf.get_i16_le();
26708 __struct.xmag = buf.get_i16_le();
26709 __struct.ymag = buf.get_i16_le();
26710 __struct.zmag = buf.get_i16_le();
26711 __struct.temperature = buf.get_i16_le();
26712 Ok(__struct)
26713 }
26714 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
26715 let mut __tmp = BytesMut::new(bytes);
26716 #[allow(clippy::absurd_extreme_comparisons)]
26717 #[allow(unused_comparisons)]
26718 if __tmp.remaining() < Self::ENCODED_LEN {
26719 panic!(
26720 "buffer is too small (need {} bytes, but got {})",
26721 Self::ENCODED_LEN,
26722 __tmp.remaining(),
26723 )
26724 }
26725 __tmp.put_u32_le(self.time_boot_ms);
26726 __tmp.put_i16_le(self.xacc);
26727 __tmp.put_i16_le(self.yacc);
26728 __tmp.put_i16_le(self.zacc);
26729 __tmp.put_i16_le(self.xgyro);
26730 __tmp.put_i16_le(self.ygyro);
26731 __tmp.put_i16_le(self.zgyro);
26732 __tmp.put_i16_le(self.xmag);
26733 __tmp.put_i16_le(self.ymag);
26734 __tmp.put_i16_le(self.zmag);
26735 if matches!(version, MavlinkVersion::V2) {
26736 __tmp.put_i16_le(self.temperature);
26737 let len = __tmp.len();
26738 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
26739 } else {
26740 __tmp.len()
26741 }
26742 }
26743}
26744#[doc = "The pressure readings for the typical setup of one absolute and differential pressure sensor. The units are as specified in each field."]
26745#[doc = ""]
26746#[doc = "ID: 29"]
26747#[derive(Debug, Clone, PartialEq)]
26748#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
26749#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
26750#[cfg_attr(feature = "ts", derive(TS))]
26751#[cfg_attr(feature = "ts", ts(export))]
26752pub struct SCALED_PRESSURE_DATA {
26753 #[doc = "Timestamp (time since system boot)."]
26754 pub time_boot_ms: u32,
26755 #[doc = "Absolute pressure"]
26756 pub press_abs: f32,
26757 #[doc = "Differential pressure 1"]
26758 pub press_diff: f32,
26759 #[doc = "Absolute pressure temperature"]
26760 pub temperature: i16,
26761 #[doc = "Differential pressure temperature (0, if not available). Report values of 0 (or 1) as 1 cdegC."]
26762 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
26763 pub temperature_press_diff: i16,
26764}
26765impl SCALED_PRESSURE_DATA {
26766 pub const ENCODED_LEN: usize = 16usize;
26767 pub const DEFAULT: Self = Self {
26768 time_boot_ms: 0_u32,
26769 press_abs: 0.0_f32,
26770 press_diff: 0.0_f32,
26771 temperature: 0_i16,
26772 temperature_press_diff: 0_i16,
26773 };
26774 #[cfg(feature = "arbitrary")]
26775 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
26776 use arbitrary::{Arbitrary, Unstructured};
26777 let mut buf = [0u8; 1024];
26778 rng.fill_bytes(&mut buf);
26779 let mut unstructured = Unstructured::new(&buf);
26780 Self::arbitrary(&mut unstructured).unwrap_or_default()
26781 }
26782}
26783impl Default for SCALED_PRESSURE_DATA {
26784 fn default() -> Self {
26785 Self::DEFAULT.clone()
26786 }
26787}
26788impl MessageData for SCALED_PRESSURE_DATA {
26789 type Message = MavMessage;
26790 const ID: u32 = 29u32;
26791 const NAME: &'static str = "SCALED_PRESSURE";
26792 const EXTRA_CRC: u8 = 115u8;
26793 const ENCODED_LEN: usize = 16usize;
26794 fn deser(
26795 _version: MavlinkVersion,
26796 __input: &[u8],
26797 ) -> Result<Self, ::mavlink_core::error::ParserError> {
26798 let avail_len = __input.len();
26799 let mut payload_buf = [0; Self::ENCODED_LEN];
26800 let mut buf = if avail_len < Self::ENCODED_LEN {
26801 payload_buf[0..avail_len].copy_from_slice(__input);
26802 Bytes::new(&payload_buf)
26803 } else {
26804 Bytes::new(__input)
26805 };
26806 let mut __struct = Self::default();
26807 __struct.time_boot_ms = buf.get_u32_le();
26808 __struct.press_abs = buf.get_f32_le();
26809 __struct.press_diff = buf.get_f32_le();
26810 __struct.temperature = buf.get_i16_le();
26811 __struct.temperature_press_diff = buf.get_i16_le();
26812 Ok(__struct)
26813 }
26814 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
26815 let mut __tmp = BytesMut::new(bytes);
26816 #[allow(clippy::absurd_extreme_comparisons)]
26817 #[allow(unused_comparisons)]
26818 if __tmp.remaining() < Self::ENCODED_LEN {
26819 panic!(
26820 "buffer is too small (need {} bytes, but got {})",
26821 Self::ENCODED_LEN,
26822 __tmp.remaining(),
26823 )
26824 }
26825 __tmp.put_u32_le(self.time_boot_ms);
26826 __tmp.put_f32_le(self.press_abs);
26827 __tmp.put_f32_le(self.press_diff);
26828 __tmp.put_i16_le(self.temperature);
26829 if matches!(version, MavlinkVersion::V2) {
26830 __tmp.put_i16_le(self.temperature_press_diff);
26831 let len = __tmp.len();
26832 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
26833 } else {
26834 __tmp.len()
26835 }
26836 }
26837}
26838#[doc = "Barometer readings for 2nd barometer."]
26839#[doc = ""]
26840#[doc = "ID: 137"]
26841#[derive(Debug, Clone, PartialEq)]
26842#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
26843#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
26844#[cfg_attr(feature = "ts", derive(TS))]
26845#[cfg_attr(feature = "ts", ts(export))]
26846pub struct SCALED_PRESSURE2_DATA {
26847 #[doc = "Timestamp (time since system boot)."]
26848 pub time_boot_ms: u32,
26849 #[doc = "Absolute pressure"]
26850 pub press_abs: f32,
26851 #[doc = "Differential pressure"]
26852 pub press_diff: f32,
26853 #[doc = "Absolute pressure temperature"]
26854 pub temperature: i16,
26855 #[doc = "Differential pressure temperature (0, if not available). Report values of 0 (or 1) as 1 cdegC."]
26856 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
26857 pub temperature_press_diff: i16,
26858}
26859impl SCALED_PRESSURE2_DATA {
26860 pub const ENCODED_LEN: usize = 16usize;
26861 pub const DEFAULT: Self = Self {
26862 time_boot_ms: 0_u32,
26863 press_abs: 0.0_f32,
26864 press_diff: 0.0_f32,
26865 temperature: 0_i16,
26866 temperature_press_diff: 0_i16,
26867 };
26868 #[cfg(feature = "arbitrary")]
26869 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
26870 use arbitrary::{Arbitrary, Unstructured};
26871 let mut buf = [0u8; 1024];
26872 rng.fill_bytes(&mut buf);
26873 let mut unstructured = Unstructured::new(&buf);
26874 Self::arbitrary(&mut unstructured).unwrap_or_default()
26875 }
26876}
26877impl Default for SCALED_PRESSURE2_DATA {
26878 fn default() -> Self {
26879 Self::DEFAULT.clone()
26880 }
26881}
26882impl MessageData for SCALED_PRESSURE2_DATA {
26883 type Message = MavMessage;
26884 const ID: u32 = 137u32;
26885 const NAME: &'static str = "SCALED_PRESSURE2";
26886 const EXTRA_CRC: u8 = 195u8;
26887 const ENCODED_LEN: usize = 16usize;
26888 fn deser(
26889 _version: MavlinkVersion,
26890 __input: &[u8],
26891 ) -> Result<Self, ::mavlink_core::error::ParserError> {
26892 let avail_len = __input.len();
26893 let mut payload_buf = [0; Self::ENCODED_LEN];
26894 let mut buf = if avail_len < Self::ENCODED_LEN {
26895 payload_buf[0..avail_len].copy_from_slice(__input);
26896 Bytes::new(&payload_buf)
26897 } else {
26898 Bytes::new(__input)
26899 };
26900 let mut __struct = Self::default();
26901 __struct.time_boot_ms = buf.get_u32_le();
26902 __struct.press_abs = buf.get_f32_le();
26903 __struct.press_diff = buf.get_f32_le();
26904 __struct.temperature = buf.get_i16_le();
26905 __struct.temperature_press_diff = buf.get_i16_le();
26906 Ok(__struct)
26907 }
26908 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
26909 let mut __tmp = BytesMut::new(bytes);
26910 #[allow(clippy::absurd_extreme_comparisons)]
26911 #[allow(unused_comparisons)]
26912 if __tmp.remaining() < Self::ENCODED_LEN {
26913 panic!(
26914 "buffer is too small (need {} bytes, but got {})",
26915 Self::ENCODED_LEN,
26916 __tmp.remaining(),
26917 )
26918 }
26919 __tmp.put_u32_le(self.time_boot_ms);
26920 __tmp.put_f32_le(self.press_abs);
26921 __tmp.put_f32_le(self.press_diff);
26922 __tmp.put_i16_le(self.temperature);
26923 if matches!(version, MavlinkVersion::V2) {
26924 __tmp.put_i16_le(self.temperature_press_diff);
26925 let len = __tmp.len();
26926 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
26927 } else {
26928 __tmp.len()
26929 }
26930 }
26931}
26932#[doc = "Barometer readings for 3rd barometer."]
26933#[doc = ""]
26934#[doc = "ID: 143"]
26935#[derive(Debug, Clone, PartialEq)]
26936#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
26937#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
26938#[cfg_attr(feature = "ts", derive(TS))]
26939#[cfg_attr(feature = "ts", ts(export))]
26940pub struct SCALED_PRESSURE3_DATA {
26941 #[doc = "Timestamp (time since system boot)."]
26942 pub time_boot_ms: u32,
26943 #[doc = "Absolute pressure"]
26944 pub press_abs: f32,
26945 #[doc = "Differential pressure"]
26946 pub press_diff: f32,
26947 #[doc = "Absolute pressure temperature"]
26948 pub temperature: i16,
26949 #[doc = "Differential pressure temperature (0, if not available). Report values of 0 (or 1) as 1 cdegC."]
26950 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
26951 pub temperature_press_diff: i16,
26952}
26953impl SCALED_PRESSURE3_DATA {
26954 pub const ENCODED_LEN: usize = 16usize;
26955 pub const DEFAULT: Self = Self {
26956 time_boot_ms: 0_u32,
26957 press_abs: 0.0_f32,
26958 press_diff: 0.0_f32,
26959 temperature: 0_i16,
26960 temperature_press_diff: 0_i16,
26961 };
26962 #[cfg(feature = "arbitrary")]
26963 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
26964 use arbitrary::{Arbitrary, Unstructured};
26965 let mut buf = [0u8; 1024];
26966 rng.fill_bytes(&mut buf);
26967 let mut unstructured = Unstructured::new(&buf);
26968 Self::arbitrary(&mut unstructured).unwrap_or_default()
26969 }
26970}
26971impl Default for SCALED_PRESSURE3_DATA {
26972 fn default() -> Self {
26973 Self::DEFAULT.clone()
26974 }
26975}
26976impl MessageData for SCALED_PRESSURE3_DATA {
26977 type Message = MavMessage;
26978 const ID: u32 = 143u32;
26979 const NAME: &'static str = "SCALED_PRESSURE3";
26980 const EXTRA_CRC: u8 = 131u8;
26981 const ENCODED_LEN: usize = 16usize;
26982 fn deser(
26983 _version: MavlinkVersion,
26984 __input: &[u8],
26985 ) -> Result<Self, ::mavlink_core::error::ParserError> {
26986 let avail_len = __input.len();
26987 let mut payload_buf = [0; Self::ENCODED_LEN];
26988 let mut buf = if avail_len < Self::ENCODED_LEN {
26989 payload_buf[0..avail_len].copy_from_slice(__input);
26990 Bytes::new(&payload_buf)
26991 } else {
26992 Bytes::new(__input)
26993 };
26994 let mut __struct = Self::default();
26995 __struct.time_boot_ms = buf.get_u32_le();
26996 __struct.press_abs = buf.get_f32_le();
26997 __struct.press_diff = buf.get_f32_le();
26998 __struct.temperature = buf.get_i16_le();
26999 __struct.temperature_press_diff = buf.get_i16_le();
27000 Ok(__struct)
27001 }
27002 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
27003 let mut __tmp = BytesMut::new(bytes);
27004 #[allow(clippy::absurd_extreme_comparisons)]
27005 #[allow(unused_comparisons)]
27006 if __tmp.remaining() < Self::ENCODED_LEN {
27007 panic!(
27008 "buffer is too small (need {} bytes, but got {})",
27009 Self::ENCODED_LEN,
27010 __tmp.remaining(),
27011 )
27012 }
27013 __tmp.put_u32_le(self.time_boot_ms);
27014 __tmp.put_f32_le(self.press_abs);
27015 __tmp.put_f32_le(self.press_diff);
27016 __tmp.put_i16_le(self.temperature);
27017 if matches!(version, MavlinkVersion::V2) {
27018 __tmp.put_i16_le(self.temperature_press_diff);
27019 let len = __tmp.len();
27020 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
27021 } else {
27022 __tmp.len()
27023 }
27024 }
27025}
27026#[doc = "Control a serial port. This can be used for raw access to an onboard serial peripheral such as a GPS or telemetry radio. It is designed to make it possible to update the devices firmware via MAVLink messages or change the devices settings. A message with zero bytes can be used to change just the baudrate."]
27027#[doc = ""]
27028#[doc = "ID: 126"]
27029#[derive(Debug, Clone, PartialEq)]
27030#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
27031#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
27032#[cfg_attr(feature = "ts", derive(TS))]
27033#[cfg_attr(feature = "ts", ts(export))]
27034pub struct SERIAL_CONTROL_DATA {
27035 #[doc = "Baudrate of transfer. Zero means no change."]
27036 pub baudrate: u32,
27037 #[doc = "Timeout for reply data"]
27038 pub timeout: u16,
27039 #[doc = "Serial control device type."]
27040 pub device: SerialControlDev,
27041 #[doc = "Bitmap of serial control flags."]
27042 pub flags: SerialControlFlag,
27043 #[doc = "how many bytes in this transfer"]
27044 pub count: u8,
27045 #[doc = "serial data"]
27046 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
27047 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
27048 pub data: [u8; 70],
27049 #[doc = "System ID"]
27050 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
27051 pub target_system: u8,
27052 #[doc = "Component ID"]
27053 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
27054 pub target_component: u8,
27055}
27056impl SERIAL_CONTROL_DATA {
27057 pub const ENCODED_LEN: usize = 81usize;
27058 pub const DEFAULT: Self = Self {
27059 baudrate: 0_u32,
27060 timeout: 0_u16,
27061 device: SerialControlDev::DEFAULT,
27062 flags: SerialControlFlag::DEFAULT,
27063 count: 0_u8,
27064 data: [0_u8; 70usize],
27065 target_system: 0_u8,
27066 target_component: 0_u8,
27067 };
27068 #[cfg(feature = "arbitrary")]
27069 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
27070 use arbitrary::{Arbitrary, Unstructured};
27071 let mut buf = [0u8; 1024];
27072 rng.fill_bytes(&mut buf);
27073 let mut unstructured = Unstructured::new(&buf);
27074 Self::arbitrary(&mut unstructured).unwrap_or_default()
27075 }
27076}
27077impl Default for SERIAL_CONTROL_DATA {
27078 fn default() -> Self {
27079 Self::DEFAULT.clone()
27080 }
27081}
27082impl MessageData for SERIAL_CONTROL_DATA {
27083 type Message = MavMessage;
27084 const ID: u32 = 126u32;
27085 const NAME: &'static str = "SERIAL_CONTROL";
27086 const EXTRA_CRC: u8 = 220u8;
27087 const ENCODED_LEN: usize = 81usize;
27088 fn deser(
27089 _version: MavlinkVersion,
27090 __input: &[u8],
27091 ) -> Result<Self, ::mavlink_core::error::ParserError> {
27092 let avail_len = __input.len();
27093 let mut payload_buf = [0; Self::ENCODED_LEN];
27094 let mut buf = if avail_len < Self::ENCODED_LEN {
27095 payload_buf[0..avail_len].copy_from_slice(__input);
27096 Bytes::new(&payload_buf)
27097 } else {
27098 Bytes::new(__input)
27099 };
27100 let mut __struct = Self::default();
27101 __struct.baudrate = buf.get_u32_le();
27102 __struct.timeout = buf.get_u16_le();
27103 let tmp = buf.get_u8();
27104 __struct.device =
27105 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
27106 enum_type: "SerialControlDev",
27107 value: tmp as u64,
27108 })?;
27109 let tmp = buf.get_u8();
27110 __struct.flags = SerialControlFlag::from_bits(tmp as <SerialControlFlag as Flags>::Bits)
27111 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
27112 flag_type: "SerialControlFlag",
27113 value: tmp as u64,
27114 })?;
27115 __struct.count = buf.get_u8();
27116 for v in &mut __struct.data {
27117 let val = buf.get_u8();
27118 *v = val;
27119 }
27120 __struct.target_system = buf.get_u8();
27121 __struct.target_component = buf.get_u8();
27122 Ok(__struct)
27123 }
27124 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
27125 let mut __tmp = BytesMut::new(bytes);
27126 #[allow(clippy::absurd_extreme_comparisons)]
27127 #[allow(unused_comparisons)]
27128 if __tmp.remaining() < Self::ENCODED_LEN {
27129 panic!(
27130 "buffer is too small (need {} bytes, but got {})",
27131 Self::ENCODED_LEN,
27132 __tmp.remaining(),
27133 )
27134 }
27135 __tmp.put_u32_le(self.baudrate);
27136 __tmp.put_u16_le(self.timeout);
27137 __tmp.put_u8(self.device as u8);
27138 __tmp.put_u8(self.flags.bits() as u8);
27139 __tmp.put_u8(self.count);
27140 for val in &self.data {
27141 __tmp.put_u8(*val);
27142 }
27143 if matches!(version, MavlinkVersion::V2) {
27144 __tmp.put_u8(self.target_system);
27145 __tmp.put_u8(self.target_component);
27146 let len = __tmp.len();
27147 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
27148 } else {
27149 __tmp.len()
27150 }
27151 }
27152}
27153#[doc = "Superseded by ACTUATOR_OUTPUT_STATUS. The RAW values of the servo outputs (for RC input from the remote, use the RC_CHANNELS messages). The standard PPM modulation is as follows: 1000 microseconds: 0%, 2000 microseconds: 100%."]
27154#[doc = ""]
27155#[doc = "ID: 36"]
27156#[derive(Debug, Clone, PartialEq)]
27157#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
27158#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
27159#[cfg_attr(feature = "ts", derive(TS))]
27160#[cfg_attr(feature = "ts", ts(export))]
27161pub struct SERVO_OUTPUT_RAW_DATA {
27162 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
27163 pub time_usec: u32,
27164 #[doc = "Servo output 1 value"]
27165 pub servo1_raw: u16,
27166 #[doc = "Servo output 2 value"]
27167 pub servo2_raw: u16,
27168 #[doc = "Servo output 3 value"]
27169 pub servo3_raw: u16,
27170 #[doc = "Servo output 4 value"]
27171 pub servo4_raw: u16,
27172 #[doc = "Servo output 5 value"]
27173 pub servo5_raw: u16,
27174 #[doc = "Servo output 6 value"]
27175 pub servo6_raw: u16,
27176 #[doc = "Servo output 7 value"]
27177 pub servo7_raw: u16,
27178 #[doc = "Servo output 8 value"]
27179 pub servo8_raw: u16,
27180 #[doc = "Servo output port (set of 8 outputs = 1 port). Flight stacks running on Pixhawk should use: 0 = MAIN, 1 = AUX."]
27181 pub port: u8,
27182 #[doc = "Servo output 9 value"]
27183 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
27184 pub servo9_raw: u16,
27185 #[doc = "Servo output 10 value"]
27186 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
27187 pub servo10_raw: u16,
27188 #[doc = "Servo output 11 value"]
27189 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
27190 pub servo11_raw: u16,
27191 #[doc = "Servo output 12 value"]
27192 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
27193 pub servo12_raw: u16,
27194 #[doc = "Servo output 13 value"]
27195 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
27196 pub servo13_raw: u16,
27197 #[doc = "Servo output 14 value"]
27198 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
27199 pub servo14_raw: u16,
27200 #[doc = "Servo output 15 value"]
27201 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
27202 pub servo15_raw: u16,
27203 #[doc = "Servo output 16 value"]
27204 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
27205 pub servo16_raw: u16,
27206}
27207impl SERVO_OUTPUT_RAW_DATA {
27208 pub const ENCODED_LEN: usize = 37usize;
27209 pub const DEFAULT: Self = Self {
27210 time_usec: 0_u32,
27211 servo1_raw: 0_u16,
27212 servo2_raw: 0_u16,
27213 servo3_raw: 0_u16,
27214 servo4_raw: 0_u16,
27215 servo5_raw: 0_u16,
27216 servo6_raw: 0_u16,
27217 servo7_raw: 0_u16,
27218 servo8_raw: 0_u16,
27219 port: 0_u8,
27220 servo9_raw: 0_u16,
27221 servo10_raw: 0_u16,
27222 servo11_raw: 0_u16,
27223 servo12_raw: 0_u16,
27224 servo13_raw: 0_u16,
27225 servo14_raw: 0_u16,
27226 servo15_raw: 0_u16,
27227 servo16_raw: 0_u16,
27228 };
27229 #[cfg(feature = "arbitrary")]
27230 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
27231 use arbitrary::{Arbitrary, Unstructured};
27232 let mut buf = [0u8; 1024];
27233 rng.fill_bytes(&mut buf);
27234 let mut unstructured = Unstructured::new(&buf);
27235 Self::arbitrary(&mut unstructured).unwrap_or_default()
27236 }
27237}
27238impl Default for SERVO_OUTPUT_RAW_DATA {
27239 fn default() -> Self {
27240 Self::DEFAULT.clone()
27241 }
27242}
27243impl MessageData for SERVO_OUTPUT_RAW_DATA {
27244 type Message = MavMessage;
27245 const ID: u32 = 36u32;
27246 const NAME: &'static str = "SERVO_OUTPUT_RAW";
27247 const EXTRA_CRC: u8 = 222u8;
27248 const ENCODED_LEN: usize = 37usize;
27249 fn deser(
27250 _version: MavlinkVersion,
27251 __input: &[u8],
27252 ) -> Result<Self, ::mavlink_core::error::ParserError> {
27253 let avail_len = __input.len();
27254 let mut payload_buf = [0; Self::ENCODED_LEN];
27255 let mut buf = if avail_len < Self::ENCODED_LEN {
27256 payload_buf[0..avail_len].copy_from_slice(__input);
27257 Bytes::new(&payload_buf)
27258 } else {
27259 Bytes::new(__input)
27260 };
27261 let mut __struct = Self::default();
27262 __struct.time_usec = buf.get_u32_le();
27263 __struct.servo1_raw = buf.get_u16_le();
27264 __struct.servo2_raw = buf.get_u16_le();
27265 __struct.servo3_raw = buf.get_u16_le();
27266 __struct.servo4_raw = buf.get_u16_le();
27267 __struct.servo5_raw = buf.get_u16_le();
27268 __struct.servo6_raw = buf.get_u16_le();
27269 __struct.servo7_raw = buf.get_u16_le();
27270 __struct.servo8_raw = buf.get_u16_le();
27271 __struct.port = buf.get_u8();
27272 __struct.servo9_raw = buf.get_u16_le();
27273 __struct.servo10_raw = buf.get_u16_le();
27274 __struct.servo11_raw = buf.get_u16_le();
27275 __struct.servo12_raw = buf.get_u16_le();
27276 __struct.servo13_raw = buf.get_u16_le();
27277 __struct.servo14_raw = buf.get_u16_le();
27278 __struct.servo15_raw = buf.get_u16_le();
27279 __struct.servo16_raw = buf.get_u16_le();
27280 Ok(__struct)
27281 }
27282 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
27283 let mut __tmp = BytesMut::new(bytes);
27284 #[allow(clippy::absurd_extreme_comparisons)]
27285 #[allow(unused_comparisons)]
27286 if __tmp.remaining() < Self::ENCODED_LEN {
27287 panic!(
27288 "buffer is too small (need {} bytes, but got {})",
27289 Self::ENCODED_LEN,
27290 __tmp.remaining(),
27291 )
27292 }
27293 __tmp.put_u32_le(self.time_usec);
27294 __tmp.put_u16_le(self.servo1_raw);
27295 __tmp.put_u16_le(self.servo2_raw);
27296 __tmp.put_u16_le(self.servo3_raw);
27297 __tmp.put_u16_le(self.servo4_raw);
27298 __tmp.put_u16_le(self.servo5_raw);
27299 __tmp.put_u16_le(self.servo6_raw);
27300 __tmp.put_u16_le(self.servo7_raw);
27301 __tmp.put_u16_le(self.servo8_raw);
27302 __tmp.put_u8(self.port);
27303 if matches!(version, MavlinkVersion::V2) {
27304 __tmp.put_u16_le(self.servo9_raw);
27305 __tmp.put_u16_le(self.servo10_raw);
27306 __tmp.put_u16_le(self.servo11_raw);
27307 __tmp.put_u16_le(self.servo12_raw);
27308 __tmp.put_u16_le(self.servo13_raw);
27309 __tmp.put_u16_le(self.servo14_raw);
27310 __tmp.put_u16_le(self.servo15_raw);
27311 __tmp.put_u16_le(self.servo16_raw);
27312 let len = __tmp.len();
27313 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
27314 } else {
27315 __tmp.len()
27316 }
27317 }
27318}
27319#[doc = "Setup a MAVLink2 signing key. If called with secret_key of all zero and zero initial_timestamp will disable signing."]
27320#[doc = ""]
27321#[doc = "ID: 256"]
27322#[derive(Debug, Clone, PartialEq)]
27323#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
27324#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
27325#[cfg_attr(feature = "ts", derive(TS))]
27326#[cfg_attr(feature = "ts", ts(export))]
27327pub struct SETUP_SIGNING_DATA {
27328 #[doc = "initial timestamp"]
27329 pub initial_timestamp: u64,
27330 #[doc = "system id of the target"]
27331 pub target_system: u8,
27332 #[doc = "component ID of the target"]
27333 pub target_component: u8,
27334 #[doc = "signing key"]
27335 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
27336 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
27337 pub secret_key: [u8; 32],
27338}
27339impl SETUP_SIGNING_DATA {
27340 pub const ENCODED_LEN: usize = 42usize;
27341 pub const DEFAULT: Self = Self {
27342 initial_timestamp: 0_u64,
27343 target_system: 0_u8,
27344 target_component: 0_u8,
27345 secret_key: [0_u8; 32usize],
27346 };
27347 #[cfg(feature = "arbitrary")]
27348 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
27349 use arbitrary::{Arbitrary, Unstructured};
27350 let mut buf = [0u8; 1024];
27351 rng.fill_bytes(&mut buf);
27352 let mut unstructured = Unstructured::new(&buf);
27353 Self::arbitrary(&mut unstructured).unwrap_or_default()
27354 }
27355}
27356impl Default for SETUP_SIGNING_DATA {
27357 fn default() -> Self {
27358 Self::DEFAULT.clone()
27359 }
27360}
27361impl MessageData for SETUP_SIGNING_DATA {
27362 type Message = MavMessage;
27363 const ID: u32 = 256u32;
27364 const NAME: &'static str = "SETUP_SIGNING";
27365 const EXTRA_CRC: u8 = 71u8;
27366 const ENCODED_LEN: usize = 42usize;
27367 fn deser(
27368 _version: MavlinkVersion,
27369 __input: &[u8],
27370 ) -> Result<Self, ::mavlink_core::error::ParserError> {
27371 let avail_len = __input.len();
27372 let mut payload_buf = [0; Self::ENCODED_LEN];
27373 let mut buf = if avail_len < Self::ENCODED_LEN {
27374 payload_buf[0..avail_len].copy_from_slice(__input);
27375 Bytes::new(&payload_buf)
27376 } else {
27377 Bytes::new(__input)
27378 };
27379 let mut __struct = Self::default();
27380 __struct.initial_timestamp = buf.get_u64_le();
27381 __struct.target_system = buf.get_u8();
27382 __struct.target_component = buf.get_u8();
27383 for v in &mut __struct.secret_key {
27384 let val = buf.get_u8();
27385 *v = val;
27386 }
27387 Ok(__struct)
27388 }
27389 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
27390 let mut __tmp = BytesMut::new(bytes);
27391 #[allow(clippy::absurd_extreme_comparisons)]
27392 #[allow(unused_comparisons)]
27393 if __tmp.remaining() < Self::ENCODED_LEN {
27394 panic!(
27395 "buffer is too small (need {} bytes, but got {})",
27396 Self::ENCODED_LEN,
27397 __tmp.remaining(),
27398 )
27399 }
27400 __tmp.put_u64_le(self.initial_timestamp);
27401 __tmp.put_u8(self.target_system);
27402 __tmp.put_u8(self.target_component);
27403 for val in &self.secret_key {
27404 __tmp.put_u8(*val);
27405 }
27406 if matches!(version, MavlinkVersion::V2) {
27407 let len = __tmp.len();
27408 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
27409 } else {
27410 __tmp.len()
27411 }
27412 }
27413}
27414#[doc = "Set the vehicle attitude and body angular rates."]
27415#[doc = ""]
27416#[doc = "ID: 139"]
27417#[derive(Debug, Clone, PartialEq)]
27418#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
27419#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
27420#[cfg_attr(feature = "ts", derive(TS))]
27421#[cfg_attr(feature = "ts", ts(export))]
27422pub struct SET_ACTUATOR_CONTROL_TARGET_DATA {
27423 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
27424 pub time_usec: u64,
27425 #[doc = "Actuator controls. Normed to -1..+1 where 0 is neutral position. Throttle for single rotation direction motors is 0..1, negative range for reverse direction. Standard mapping for attitude controls (group 0): (index 0-7): roll, pitch, yaw, throttle, flaps, spoilers, airbrakes, landing gear. Load a pass-through mixer to repurpose them as generic outputs."]
27426 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
27427 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
27428 pub controls: [f32; 8],
27429 #[doc = "Actuator group. The \"_mlx\" indicates this is a multi-instance message and a MAVLink parser should use this field to difference between instances."]
27430 pub group_mlx: u8,
27431 #[doc = "System ID"]
27432 pub target_system: u8,
27433 #[doc = "Component ID"]
27434 pub target_component: u8,
27435}
27436impl SET_ACTUATOR_CONTROL_TARGET_DATA {
27437 pub const ENCODED_LEN: usize = 43usize;
27438 pub const DEFAULT: Self = Self {
27439 time_usec: 0_u64,
27440 controls: [0.0_f32; 8usize],
27441 group_mlx: 0_u8,
27442 target_system: 0_u8,
27443 target_component: 0_u8,
27444 };
27445 #[cfg(feature = "arbitrary")]
27446 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
27447 use arbitrary::{Arbitrary, Unstructured};
27448 let mut buf = [0u8; 1024];
27449 rng.fill_bytes(&mut buf);
27450 let mut unstructured = Unstructured::new(&buf);
27451 Self::arbitrary(&mut unstructured).unwrap_or_default()
27452 }
27453}
27454impl Default for SET_ACTUATOR_CONTROL_TARGET_DATA {
27455 fn default() -> Self {
27456 Self::DEFAULT.clone()
27457 }
27458}
27459impl MessageData for SET_ACTUATOR_CONTROL_TARGET_DATA {
27460 type Message = MavMessage;
27461 const ID: u32 = 139u32;
27462 const NAME: &'static str = "SET_ACTUATOR_CONTROL_TARGET";
27463 const EXTRA_CRC: u8 = 168u8;
27464 const ENCODED_LEN: usize = 43usize;
27465 fn deser(
27466 _version: MavlinkVersion,
27467 __input: &[u8],
27468 ) -> Result<Self, ::mavlink_core::error::ParserError> {
27469 let avail_len = __input.len();
27470 let mut payload_buf = [0; Self::ENCODED_LEN];
27471 let mut buf = if avail_len < Self::ENCODED_LEN {
27472 payload_buf[0..avail_len].copy_from_slice(__input);
27473 Bytes::new(&payload_buf)
27474 } else {
27475 Bytes::new(__input)
27476 };
27477 let mut __struct = Self::default();
27478 __struct.time_usec = buf.get_u64_le();
27479 for v in &mut __struct.controls {
27480 let val = buf.get_f32_le();
27481 *v = val;
27482 }
27483 __struct.group_mlx = buf.get_u8();
27484 __struct.target_system = buf.get_u8();
27485 __struct.target_component = buf.get_u8();
27486 Ok(__struct)
27487 }
27488 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
27489 let mut __tmp = BytesMut::new(bytes);
27490 #[allow(clippy::absurd_extreme_comparisons)]
27491 #[allow(unused_comparisons)]
27492 if __tmp.remaining() < Self::ENCODED_LEN {
27493 panic!(
27494 "buffer is too small (need {} bytes, but got {})",
27495 Self::ENCODED_LEN,
27496 __tmp.remaining(),
27497 )
27498 }
27499 __tmp.put_u64_le(self.time_usec);
27500 for val in &self.controls {
27501 __tmp.put_f32_le(*val);
27502 }
27503 __tmp.put_u8(self.group_mlx);
27504 __tmp.put_u8(self.target_system);
27505 __tmp.put_u8(self.target_component);
27506 if matches!(version, MavlinkVersion::V2) {
27507 let len = __tmp.len();
27508 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
27509 } else {
27510 __tmp.len()
27511 }
27512 }
27513}
27514#[doc = "Sets a desired vehicle attitude. Used by an external controller to command the vehicle (manual controller or other system)."]
27515#[doc = ""]
27516#[doc = "ID: 82"]
27517#[derive(Debug, Clone, PartialEq)]
27518#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
27519#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
27520#[cfg_attr(feature = "ts", derive(TS))]
27521#[cfg_attr(feature = "ts", ts(export))]
27522pub struct SET_ATTITUDE_TARGET_DATA {
27523 #[doc = "Timestamp (time since system boot)."]
27524 pub time_boot_ms: u32,
27525 #[doc = "Attitude quaternion (w, x, y, z order, zero-rotation is 1, 0, 0, 0) from MAV_FRAME_LOCAL_NED to MAV_FRAME_BODY_FRD"]
27526 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
27527 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
27528 pub q: [f32; 4],
27529 #[doc = "Body roll rate"]
27530 pub body_roll_rate: f32,
27531 #[doc = "Body pitch rate"]
27532 pub body_pitch_rate: f32,
27533 #[doc = "Body yaw rate"]
27534 pub body_yaw_rate: f32,
27535 #[doc = "Collective thrust, normalized to 0 .. 1 (-1 .. 1 for vehicles capable of reverse trust)"]
27536 pub thrust: f32,
27537 #[doc = "System ID"]
27538 pub target_system: u8,
27539 #[doc = "Component ID"]
27540 pub target_component: u8,
27541 #[doc = "Bitmap to indicate which dimensions should be ignored by the vehicle."]
27542 pub type_mask: AttitudeTargetTypemask,
27543 #[doc = "3D thrust setpoint in the body NED frame, normalized to -1 .. 1"]
27544 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
27545 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
27546 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
27547 pub thrust_body: [f32; 3],
27548}
27549impl SET_ATTITUDE_TARGET_DATA {
27550 pub const ENCODED_LEN: usize = 51usize;
27551 pub const DEFAULT: Self = Self {
27552 time_boot_ms: 0_u32,
27553 q: [0.0_f32; 4usize],
27554 body_roll_rate: 0.0_f32,
27555 body_pitch_rate: 0.0_f32,
27556 body_yaw_rate: 0.0_f32,
27557 thrust: 0.0_f32,
27558 target_system: 0_u8,
27559 target_component: 0_u8,
27560 type_mask: AttitudeTargetTypemask::DEFAULT,
27561 thrust_body: [0.0_f32; 3usize],
27562 };
27563 #[cfg(feature = "arbitrary")]
27564 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
27565 use arbitrary::{Arbitrary, Unstructured};
27566 let mut buf = [0u8; 1024];
27567 rng.fill_bytes(&mut buf);
27568 let mut unstructured = Unstructured::new(&buf);
27569 Self::arbitrary(&mut unstructured).unwrap_or_default()
27570 }
27571}
27572impl Default for SET_ATTITUDE_TARGET_DATA {
27573 fn default() -> Self {
27574 Self::DEFAULT.clone()
27575 }
27576}
27577impl MessageData for SET_ATTITUDE_TARGET_DATA {
27578 type Message = MavMessage;
27579 const ID: u32 = 82u32;
27580 const NAME: &'static str = "SET_ATTITUDE_TARGET";
27581 const EXTRA_CRC: u8 = 49u8;
27582 const ENCODED_LEN: usize = 51usize;
27583 fn deser(
27584 _version: MavlinkVersion,
27585 __input: &[u8],
27586 ) -> Result<Self, ::mavlink_core::error::ParserError> {
27587 let avail_len = __input.len();
27588 let mut payload_buf = [0; Self::ENCODED_LEN];
27589 let mut buf = if avail_len < Self::ENCODED_LEN {
27590 payload_buf[0..avail_len].copy_from_slice(__input);
27591 Bytes::new(&payload_buf)
27592 } else {
27593 Bytes::new(__input)
27594 };
27595 let mut __struct = Self::default();
27596 __struct.time_boot_ms = buf.get_u32_le();
27597 for v in &mut __struct.q {
27598 let val = buf.get_f32_le();
27599 *v = val;
27600 }
27601 __struct.body_roll_rate = buf.get_f32_le();
27602 __struct.body_pitch_rate = buf.get_f32_le();
27603 __struct.body_yaw_rate = buf.get_f32_le();
27604 __struct.thrust = buf.get_f32_le();
27605 __struct.target_system = buf.get_u8();
27606 __struct.target_component = buf.get_u8();
27607 let tmp = buf.get_u8();
27608 __struct.type_mask =
27609 AttitudeTargetTypemask::from_bits(tmp as <AttitudeTargetTypemask as Flags>::Bits)
27610 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
27611 flag_type: "AttitudeTargetTypemask",
27612 value: tmp as u64,
27613 })?;
27614 for v in &mut __struct.thrust_body {
27615 let val = buf.get_f32_le();
27616 *v = val;
27617 }
27618 Ok(__struct)
27619 }
27620 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
27621 let mut __tmp = BytesMut::new(bytes);
27622 #[allow(clippy::absurd_extreme_comparisons)]
27623 #[allow(unused_comparisons)]
27624 if __tmp.remaining() < Self::ENCODED_LEN {
27625 panic!(
27626 "buffer is too small (need {} bytes, but got {})",
27627 Self::ENCODED_LEN,
27628 __tmp.remaining(),
27629 )
27630 }
27631 __tmp.put_u32_le(self.time_boot_ms);
27632 for val in &self.q {
27633 __tmp.put_f32_le(*val);
27634 }
27635 __tmp.put_f32_le(self.body_roll_rate);
27636 __tmp.put_f32_le(self.body_pitch_rate);
27637 __tmp.put_f32_le(self.body_yaw_rate);
27638 __tmp.put_f32_le(self.thrust);
27639 __tmp.put_u8(self.target_system);
27640 __tmp.put_u8(self.target_component);
27641 __tmp.put_u8(self.type_mask.bits() as u8);
27642 if matches!(version, MavlinkVersion::V2) {
27643 for val in &self.thrust_body {
27644 __tmp.put_f32_le(*val);
27645 }
27646 let len = __tmp.len();
27647 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
27648 } else {
27649 __tmp.len()
27650 }
27651 }
27652}
27653#[deprecated = " See `MAV_CMD_SET_GLOBAL_ORIGIN` (Deprecated since 2025-04)"]
27654#[doc = "Sets the GPS coordinates of the vehicle local origin (0,0,0) position. Vehicle should emit GPS_GLOBAL_ORIGIN irrespective of whether the origin is changed. This enables transform between the local coordinate frame and the global (GPS) coordinate frame, which may be necessary when (for example) indoor and outdoor settings are connected and the MAV should move from in- to outdoor."]
27655#[doc = ""]
27656#[doc = "ID: 48"]
27657#[derive(Debug, Clone, PartialEq)]
27658#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
27659#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
27660#[cfg_attr(feature = "ts", derive(TS))]
27661#[cfg_attr(feature = "ts", ts(export))]
27662pub struct SET_GPS_GLOBAL_ORIGIN_DATA {
27663 #[doc = "Latitude (WGS84)"]
27664 pub latitude: i32,
27665 #[doc = "Longitude (WGS84)"]
27666 pub longitude: i32,
27667 #[doc = "Altitude (MSL). Positive for up."]
27668 pub altitude: i32,
27669 #[doc = "System ID"]
27670 pub target_system: u8,
27671 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
27672 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
27673 pub time_usec: u64,
27674}
27675impl SET_GPS_GLOBAL_ORIGIN_DATA {
27676 pub const ENCODED_LEN: usize = 21usize;
27677 pub const DEFAULT: Self = Self {
27678 latitude: 0_i32,
27679 longitude: 0_i32,
27680 altitude: 0_i32,
27681 target_system: 0_u8,
27682 time_usec: 0_u64,
27683 };
27684 #[cfg(feature = "arbitrary")]
27685 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
27686 use arbitrary::{Arbitrary, Unstructured};
27687 let mut buf = [0u8; 1024];
27688 rng.fill_bytes(&mut buf);
27689 let mut unstructured = Unstructured::new(&buf);
27690 Self::arbitrary(&mut unstructured).unwrap_or_default()
27691 }
27692}
27693impl Default for SET_GPS_GLOBAL_ORIGIN_DATA {
27694 fn default() -> Self {
27695 Self::DEFAULT.clone()
27696 }
27697}
27698impl MessageData for SET_GPS_GLOBAL_ORIGIN_DATA {
27699 type Message = MavMessage;
27700 const ID: u32 = 48u32;
27701 const NAME: &'static str = "SET_GPS_GLOBAL_ORIGIN";
27702 const EXTRA_CRC: u8 = 41u8;
27703 const ENCODED_LEN: usize = 21usize;
27704 fn deser(
27705 _version: MavlinkVersion,
27706 __input: &[u8],
27707 ) -> Result<Self, ::mavlink_core::error::ParserError> {
27708 let avail_len = __input.len();
27709 let mut payload_buf = [0; Self::ENCODED_LEN];
27710 let mut buf = if avail_len < Self::ENCODED_LEN {
27711 payload_buf[0..avail_len].copy_from_slice(__input);
27712 Bytes::new(&payload_buf)
27713 } else {
27714 Bytes::new(__input)
27715 };
27716 let mut __struct = Self::default();
27717 __struct.latitude = buf.get_i32_le();
27718 __struct.longitude = buf.get_i32_le();
27719 __struct.altitude = buf.get_i32_le();
27720 __struct.target_system = buf.get_u8();
27721 __struct.time_usec = buf.get_u64_le();
27722 Ok(__struct)
27723 }
27724 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
27725 let mut __tmp = BytesMut::new(bytes);
27726 #[allow(clippy::absurd_extreme_comparisons)]
27727 #[allow(unused_comparisons)]
27728 if __tmp.remaining() < Self::ENCODED_LEN {
27729 panic!(
27730 "buffer is too small (need {} bytes, but got {})",
27731 Self::ENCODED_LEN,
27732 __tmp.remaining(),
27733 )
27734 }
27735 __tmp.put_i32_le(self.latitude);
27736 __tmp.put_i32_le(self.longitude);
27737 __tmp.put_i32_le(self.altitude);
27738 __tmp.put_u8(self.target_system);
27739 if matches!(version, MavlinkVersion::V2) {
27740 __tmp.put_u64_le(self.time_usec);
27741 let len = __tmp.len();
27742 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
27743 } else {
27744 __tmp.len()
27745 }
27746 }
27747}
27748#[deprecated = "The command protocol version (MAV_CMD_DO_SET_HOME) allows a GCS to detect when setting the home position has failed. See `MAV_CMD_DO_SET_HOME` (Deprecated since 2022-02)"]
27749#[doc = "Sets the home position. \tThe home position is the default position that the system will return to and land on. The position is set automatically by the system during the takeoff (and may also be set using this message). The global and local positions encode the position in the respective coordinate frames, while the q parameter encodes the orientation of the surface. Under normal conditions it describes the heading and terrain slope, which can be used by the aircraft to adjust the approach. The approach 3D vector describes the point to which the system should fly in normal flight mode and then perform a landing sequence along the vector. Note: the current home position may be emitted in a HOME_POSITION message on request (using MAV_CMD_REQUEST_MESSAGE with param1=242)."]
27750#[doc = ""]
27751#[doc = "ID: 243"]
27752#[derive(Debug, Clone, PartialEq)]
27753#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
27754#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
27755#[cfg_attr(feature = "ts", derive(TS))]
27756#[cfg_attr(feature = "ts", ts(export))]
27757pub struct SET_HOME_POSITION_DATA {
27758 #[doc = "Latitude (WGS84)"]
27759 pub latitude: i32,
27760 #[doc = "Longitude (WGS84)"]
27761 pub longitude: i32,
27762 #[doc = "Altitude (MSL). Positive for up."]
27763 pub altitude: i32,
27764 #[doc = "Local X position of this position in the local coordinate frame (NED)"]
27765 pub x: f32,
27766 #[doc = "Local Y position of this position in the local coordinate frame (NED)"]
27767 pub y: f32,
27768 #[doc = "Local Z position of this position in the local coordinate frame (NED: positive \"down\")"]
27769 pub z: f32,
27770 #[doc = "World to surface normal and heading transformation of the takeoff position. Used to indicate the heading and slope of the ground"]
27771 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
27772 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
27773 pub q: [f32; 4],
27774 #[doc = "Local X position of the end of the approach vector. Multicopters should set this position based on their takeoff path. Grass-landing fixed wing aircraft should set it the same way as multicopters. Runway-landing fixed wing aircraft should set it to the opposite direction of the takeoff, assuming the takeoff happened from the threshold / touchdown zone."]
27775 pub approach_x: f32,
27776 #[doc = "Local Y position of the end of the approach vector. Multicopters should set this position based on their takeoff path. Grass-landing fixed wing aircraft should set it the same way as multicopters. Runway-landing fixed wing aircraft should set it to the opposite direction of the takeoff, assuming the takeoff happened from the threshold / touchdown zone."]
27777 pub approach_y: f32,
27778 #[doc = "Local Z position of the end of the approach vector. Multicopters should set this position based on their takeoff path. Grass-landing fixed wing aircraft should set it the same way as multicopters. Runway-landing fixed wing aircraft should set it to the opposite direction of the takeoff, assuming the takeoff happened from the threshold / touchdown zone."]
27779 pub approach_z: f32,
27780 #[doc = "System ID."]
27781 pub target_system: u8,
27782 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
27783 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
27784 pub time_usec: u64,
27785}
27786impl SET_HOME_POSITION_DATA {
27787 pub const ENCODED_LEN: usize = 61usize;
27788 pub const DEFAULT: Self = Self {
27789 latitude: 0_i32,
27790 longitude: 0_i32,
27791 altitude: 0_i32,
27792 x: 0.0_f32,
27793 y: 0.0_f32,
27794 z: 0.0_f32,
27795 q: [0.0_f32; 4usize],
27796 approach_x: 0.0_f32,
27797 approach_y: 0.0_f32,
27798 approach_z: 0.0_f32,
27799 target_system: 0_u8,
27800 time_usec: 0_u64,
27801 };
27802 #[cfg(feature = "arbitrary")]
27803 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
27804 use arbitrary::{Arbitrary, Unstructured};
27805 let mut buf = [0u8; 1024];
27806 rng.fill_bytes(&mut buf);
27807 let mut unstructured = Unstructured::new(&buf);
27808 Self::arbitrary(&mut unstructured).unwrap_or_default()
27809 }
27810}
27811impl Default for SET_HOME_POSITION_DATA {
27812 fn default() -> Self {
27813 Self::DEFAULT.clone()
27814 }
27815}
27816impl MessageData for SET_HOME_POSITION_DATA {
27817 type Message = MavMessage;
27818 const ID: u32 = 243u32;
27819 const NAME: &'static str = "SET_HOME_POSITION";
27820 const EXTRA_CRC: u8 = 85u8;
27821 const ENCODED_LEN: usize = 61usize;
27822 fn deser(
27823 _version: MavlinkVersion,
27824 __input: &[u8],
27825 ) -> Result<Self, ::mavlink_core::error::ParserError> {
27826 let avail_len = __input.len();
27827 let mut payload_buf = [0; Self::ENCODED_LEN];
27828 let mut buf = if avail_len < Self::ENCODED_LEN {
27829 payload_buf[0..avail_len].copy_from_slice(__input);
27830 Bytes::new(&payload_buf)
27831 } else {
27832 Bytes::new(__input)
27833 };
27834 let mut __struct = Self::default();
27835 __struct.latitude = buf.get_i32_le();
27836 __struct.longitude = buf.get_i32_le();
27837 __struct.altitude = buf.get_i32_le();
27838 __struct.x = buf.get_f32_le();
27839 __struct.y = buf.get_f32_le();
27840 __struct.z = buf.get_f32_le();
27841 for v in &mut __struct.q {
27842 let val = buf.get_f32_le();
27843 *v = val;
27844 }
27845 __struct.approach_x = buf.get_f32_le();
27846 __struct.approach_y = buf.get_f32_le();
27847 __struct.approach_z = buf.get_f32_le();
27848 __struct.target_system = buf.get_u8();
27849 __struct.time_usec = buf.get_u64_le();
27850 Ok(__struct)
27851 }
27852 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
27853 let mut __tmp = BytesMut::new(bytes);
27854 #[allow(clippy::absurd_extreme_comparisons)]
27855 #[allow(unused_comparisons)]
27856 if __tmp.remaining() < Self::ENCODED_LEN {
27857 panic!(
27858 "buffer is too small (need {} bytes, but got {})",
27859 Self::ENCODED_LEN,
27860 __tmp.remaining(),
27861 )
27862 }
27863 __tmp.put_i32_le(self.latitude);
27864 __tmp.put_i32_le(self.longitude);
27865 __tmp.put_i32_le(self.altitude);
27866 __tmp.put_f32_le(self.x);
27867 __tmp.put_f32_le(self.y);
27868 __tmp.put_f32_le(self.z);
27869 for val in &self.q {
27870 __tmp.put_f32_le(*val);
27871 }
27872 __tmp.put_f32_le(self.approach_x);
27873 __tmp.put_f32_le(self.approach_y);
27874 __tmp.put_f32_le(self.approach_z);
27875 __tmp.put_u8(self.target_system);
27876 if matches!(version, MavlinkVersion::V2) {
27877 __tmp.put_u64_le(self.time_usec);
27878 let len = __tmp.len();
27879 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
27880 } else {
27881 __tmp.len()
27882 }
27883 }
27884}
27885#[deprecated = "Use COMMAND_LONG with MAV_CMD_DO_SET_MODE instead. See `MAV_CMD_DO_SET_MODE` (Deprecated since 2015-12)"]
27886#[doc = "Set the system mode, as defined by enum MAV_MODE. There is no target component id as the mode is by definition for the overall aircraft, not only for one component."]
27887#[doc = ""]
27888#[doc = "ID: 11"]
27889#[derive(Debug, Clone, PartialEq)]
27890#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
27891#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
27892#[cfg_attr(feature = "ts", derive(TS))]
27893#[cfg_attr(feature = "ts", ts(export))]
27894pub struct SET_MODE_DATA {
27895 #[doc = "The new autopilot-specific mode. This field can be ignored by an autopilot."]
27896 pub custom_mode: u32,
27897 #[doc = "The system setting the mode"]
27898 pub target_system: u8,
27899 #[doc = "The new base mode."]
27900 pub base_mode: MavMode,
27901}
27902impl SET_MODE_DATA {
27903 pub const ENCODED_LEN: usize = 6usize;
27904 pub const DEFAULT: Self = Self {
27905 custom_mode: 0_u32,
27906 target_system: 0_u8,
27907 base_mode: MavMode::DEFAULT,
27908 };
27909 #[cfg(feature = "arbitrary")]
27910 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
27911 use arbitrary::{Arbitrary, Unstructured};
27912 let mut buf = [0u8; 1024];
27913 rng.fill_bytes(&mut buf);
27914 let mut unstructured = Unstructured::new(&buf);
27915 Self::arbitrary(&mut unstructured).unwrap_or_default()
27916 }
27917}
27918impl Default for SET_MODE_DATA {
27919 fn default() -> Self {
27920 Self::DEFAULT.clone()
27921 }
27922}
27923impl MessageData for SET_MODE_DATA {
27924 type Message = MavMessage;
27925 const ID: u32 = 11u32;
27926 const NAME: &'static str = "SET_MODE";
27927 const EXTRA_CRC: u8 = 89u8;
27928 const ENCODED_LEN: usize = 6usize;
27929 fn deser(
27930 _version: MavlinkVersion,
27931 __input: &[u8],
27932 ) -> Result<Self, ::mavlink_core::error::ParserError> {
27933 let avail_len = __input.len();
27934 let mut payload_buf = [0; Self::ENCODED_LEN];
27935 let mut buf = if avail_len < Self::ENCODED_LEN {
27936 payload_buf[0..avail_len].copy_from_slice(__input);
27937 Bytes::new(&payload_buf)
27938 } else {
27939 Bytes::new(__input)
27940 };
27941 let mut __struct = Self::default();
27942 __struct.custom_mode = buf.get_u32_le();
27943 __struct.target_system = buf.get_u8();
27944 let tmp = buf.get_u8();
27945 __struct.base_mode =
27946 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
27947 enum_type: "MavMode",
27948 value: tmp as u64,
27949 })?;
27950 Ok(__struct)
27951 }
27952 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
27953 let mut __tmp = BytesMut::new(bytes);
27954 #[allow(clippy::absurd_extreme_comparisons)]
27955 #[allow(unused_comparisons)]
27956 if __tmp.remaining() < Self::ENCODED_LEN {
27957 panic!(
27958 "buffer is too small (need {} bytes, but got {})",
27959 Self::ENCODED_LEN,
27960 __tmp.remaining(),
27961 )
27962 }
27963 __tmp.put_u32_le(self.custom_mode);
27964 __tmp.put_u8(self.target_system);
27965 __tmp.put_u8(self.base_mode as u8);
27966 if matches!(version, MavlinkVersion::V2) {
27967 let len = __tmp.len();
27968 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
27969 } else {
27970 __tmp.len()
27971 }
27972 }
27973}
27974#[doc = "Sets a desired vehicle position, velocity, and/or acceleration in a global coordinate system (WGS84). Used by an external controller to command the vehicle (manual controller or other system)."]
27975#[doc = ""]
27976#[doc = "ID: 86"]
27977#[derive(Debug, Clone, PartialEq)]
27978#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
27979#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
27980#[cfg_attr(feature = "ts", derive(TS))]
27981#[cfg_attr(feature = "ts", ts(export))]
27982pub struct SET_POSITION_TARGET_GLOBAL_INT_DATA {
27983 #[doc = "Timestamp (time since system boot). The rationale for the timestamp in the setpoint is to allow the system to compensate for the transport delay of the setpoint. This allows the system to compensate processing latency."]
27984 pub time_boot_ms: u32,
27985 #[doc = "Latitude in WGS84 frame"]
27986 pub lat_int: i32,
27987 #[doc = "Longitude in WGS84 frame"]
27988 pub lon_int: i32,
27989 #[doc = "Altitude (MSL, Relative to home, or AGL - depending on frame)"]
27990 pub alt: f32,
27991 #[doc = "X velocity in NED frame"]
27992 pub vx: f32,
27993 #[doc = "Y velocity in NED frame"]
27994 pub vy: f32,
27995 #[doc = "Z velocity in NED frame"]
27996 pub vz: f32,
27997 #[doc = "X acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N"]
27998 pub afx: f32,
27999 #[doc = "Y acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N"]
28000 pub afy: f32,
28001 #[doc = "Z acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N"]
28002 pub afz: f32,
28003 #[doc = "yaw setpoint"]
28004 pub yaw: f32,
28005 #[doc = "yaw rate setpoint"]
28006 pub yaw_rate: f32,
28007 #[doc = "Bitmap to indicate which dimensions should be ignored by the vehicle."]
28008 pub type_mask: PositionTargetTypemask,
28009 #[doc = "System ID"]
28010 pub target_system: u8,
28011 #[doc = "Component ID"]
28012 pub target_component: u8,
28013 #[doc = "Valid options are: MAV_FRAME_GLOBAL = 0, MAV_FRAME_GLOBAL_RELATIVE_ALT = 3, MAV_FRAME_GLOBAL_TERRAIN_ALT = 10 (MAV_FRAME_GLOBAL_INT, MAV_FRAME_GLOBAL_RELATIVE_ALT_INT, MAV_FRAME_GLOBAL_TERRAIN_ALT_INT are allowed synonyms, but have been deprecated)"]
28014 pub coordinate_frame: MavFrame,
28015}
28016impl SET_POSITION_TARGET_GLOBAL_INT_DATA {
28017 pub const ENCODED_LEN: usize = 53usize;
28018 pub const DEFAULT: Self = Self {
28019 time_boot_ms: 0_u32,
28020 lat_int: 0_i32,
28021 lon_int: 0_i32,
28022 alt: 0.0_f32,
28023 vx: 0.0_f32,
28024 vy: 0.0_f32,
28025 vz: 0.0_f32,
28026 afx: 0.0_f32,
28027 afy: 0.0_f32,
28028 afz: 0.0_f32,
28029 yaw: 0.0_f32,
28030 yaw_rate: 0.0_f32,
28031 type_mask: PositionTargetTypemask::DEFAULT,
28032 target_system: 0_u8,
28033 target_component: 0_u8,
28034 coordinate_frame: MavFrame::DEFAULT,
28035 };
28036 #[cfg(feature = "arbitrary")]
28037 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
28038 use arbitrary::{Arbitrary, Unstructured};
28039 let mut buf = [0u8; 1024];
28040 rng.fill_bytes(&mut buf);
28041 let mut unstructured = Unstructured::new(&buf);
28042 Self::arbitrary(&mut unstructured).unwrap_or_default()
28043 }
28044}
28045impl Default for SET_POSITION_TARGET_GLOBAL_INT_DATA {
28046 fn default() -> Self {
28047 Self::DEFAULT.clone()
28048 }
28049}
28050impl MessageData for SET_POSITION_TARGET_GLOBAL_INT_DATA {
28051 type Message = MavMessage;
28052 const ID: u32 = 86u32;
28053 const NAME: &'static str = "SET_POSITION_TARGET_GLOBAL_INT";
28054 const EXTRA_CRC: u8 = 5u8;
28055 const ENCODED_LEN: usize = 53usize;
28056 fn deser(
28057 _version: MavlinkVersion,
28058 __input: &[u8],
28059 ) -> Result<Self, ::mavlink_core::error::ParserError> {
28060 let avail_len = __input.len();
28061 let mut payload_buf = [0; Self::ENCODED_LEN];
28062 let mut buf = if avail_len < Self::ENCODED_LEN {
28063 payload_buf[0..avail_len].copy_from_slice(__input);
28064 Bytes::new(&payload_buf)
28065 } else {
28066 Bytes::new(__input)
28067 };
28068 let mut __struct = Self::default();
28069 __struct.time_boot_ms = buf.get_u32_le();
28070 __struct.lat_int = buf.get_i32_le();
28071 __struct.lon_int = buf.get_i32_le();
28072 __struct.alt = buf.get_f32_le();
28073 __struct.vx = buf.get_f32_le();
28074 __struct.vy = buf.get_f32_le();
28075 __struct.vz = buf.get_f32_le();
28076 __struct.afx = buf.get_f32_le();
28077 __struct.afy = buf.get_f32_le();
28078 __struct.afz = buf.get_f32_le();
28079 __struct.yaw = buf.get_f32_le();
28080 __struct.yaw_rate = buf.get_f32_le();
28081 let tmp = buf.get_u16_le();
28082 __struct.type_mask =
28083 PositionTargetTypemask::from_bits(tmp as <PositionTargetTypemask as Flags>::Bits)
28084 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
28085 flag_type: "PositionTargetTypemask",
28086 value: tmp as u64,
28087 })?;
28088 __struct.target_system = buf.get_u8();
28089 __struct.target_component = buf.get_u8();
28090 let tmp = buf.get_u8();
28091 __struct.coordinate_frame =
28092 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
28093 enum_type: "MavFrame",
28094 value: tmp as u64,
28095 })?;
28096 Ok(__struct)
28097 }
28098 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
28099 let mut __tmp = BytesMut::new(bytes);
28100 #[allow(clippy::absurd_extreme_comparisons)]
28101 #[allow(unused_comparisons)]
28102 if __tmp.remaining() < Self::ENCODED_LEN {
28103 panic!(
28104 "buffer is too small (need {} bytes, but got {})",
28105 Self::ENCODED_LEN,
28106 __tmp.remaining(),
28107 )
28108 }
28109 __tmp.put_u32_le(self.time_boot_ms);
28110 __tmp.put_i32_le(self.lat_int);
28111 __tmp.put_i32_le(self.lon_int);
28112 __tmp.put_f32_le(self.alt);
28113 __tmp.put_f32_le(self.vx);
28114 __tmp.put_f32_le(self.vy);
28115 __tmp.put_f32_le(self.vz);
28116 __tmp.put_f32_le(self.afx);
28117 __tmp.put_f32_le(self.afy);
28118 __tmp.put_f32_le(self.afz);
28119 __tmp.put_f32_le(self.yaw);
28120 __tmp.put_f32_le(self.yaw_rate);
28121 __tmp.put_u16_le(self.type_mask.bits() as u16);
28122 __tmp.put_u8(self.target_system);
28123 __tmp.put_u8(self.target_component);
28124 __tmp.put_u8(self.coordinate_frame as u8);
28125 if matches!(version, MavlinkVersion::V2) {
28126 let len = __tmp.len();
28127 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
28128 } else {
28129 __tmp.len()
28130 }
28131 }
28132}
28133#[doc = "Sets a desired vehicle position in a local north-east-down coordinate frame. Used by an external controller to command the vehicle (manual controller or other system)."]
28134#[doc = ""]
28135#[doc = "ID: 84"]
28136#[derive(Debug, Clone, PartialEq)]
28137#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
28138#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
28139#[cfg_attr(feature = "ts", derive(TS))]
28140#[cfg_attr(feature = "ts", ts(export))]
28141pub struct SET_POSITION_TARGET_LOCAL_NED_DATA {
28142 #[doc = "Timestamp (time since system boot)."]
28143 pub time_boot_ms: u32,
28144 #[doc = "X Position in NED frame"]
28145 pub x: f32,
28146 #[doc = "Y Position in NED frame"]
28147 pub y: f32,
28148 #[doc = "Z Position in NED frame (note, altitude is negative in NED)"]
28149 pub z: f32,
28150 #[doc = "X velocity in NED frame"]
28151 pub vx: f32,
28152 #[doc = "Y velocity in NED frame"]
28153 pub vy: f32,
28154 #[doc = "Z velocity in NED frame"]
28155 pub vz: f32,
28156 #[doc = "X acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N"]
28157 pub afx: f32,
28158 #[doc = "Y acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N"]
28159 pub afy: f32,
28160 #[doc = "Z acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N"]
28161 pub afz: f32,
28162 #[doc = "yaw setpoint"]
28163 pub yaw: f32,
28164 #[doc = "yaw rate setpoint"]
28165 pub yaw_rate: f32,
28166 #[doc = "Bitmap to indicate which dimensions should be ignored by the vehicle."]
28167 pub type_mask: PositionTargetTypemask,
28168 #[doc = "System ID"]
28169 pub target_system: u8,
28170 #[doc = "Component ID"]
28171 pub target_component: u8,
28172 #[doc = "Valid options are: MAV_FRAME_LOCAL_NED = 1, MAV_FRAME_LOCAL_OFFSET_NED = 7, MAV_FRAME_BODY_NED = 8, MAV_FRAME_BODY_OFFSET_NED = 9"]
28173 pub coordinate_frame: MavFrame,
28174}
28175impl SET_POSITION_TARGET_LOCAL_NED_DATA {
28176 pub const ENCODED_LEN: usize = 53usize;
28177 pub const DEFAULT: Self = Self {
28178 time_boot_ms: 0_u32,
28179 x: 0.0_f32,
28180 y: 0.0_f32,
28181 z: 0.0_f32,
28182 vx: 0.0_f32,
28183 vy: 0.0_f32,
28184 vz: 0.0_f32,
28185 afx: 0.0_f32,
28186 afy: 0.0_f32,
28187 afz: 0.0_f32,
28188 yaw: 0.0_f32,
28189 yaw_rate: 0.0_f32,
28190 type_mask: PositionTargetTypemask::DEFAULT,
28191 target_system: 0_u8,
28192 target_component: 0_u8,
28193 coordinate_frame: MavFrame::DEFAULT,
28194 };
28195 #[cfg(feature = "arbitrary")]
28196 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
28197 use arbitrary::{Arbitrary, Unstructured};
28198 let mut buf = [0u8; 1024];
28199 rng.fill_bytes(&mut buf);
28200 let mut unstructured = Unstructured::new(&buf);
28201 Self::arbitrary(&mut unstructured).unwrap_or_default()
28202 }
28203}
28204impl Default for SET_POSITION_TARGET_LOCAL_NED_DATA {
28205 fn default() -> Self {
28206 Self::DEFAULT.clone()
28207 }
28208}
28209impl MessageData for SET_POSITION_TARGET_LOCAL_NED_DATA {
28210 type Message = MavMessage;
28211 const ID: u32 = 84u32;
28212 const NAME: &'static str = "SET_POSITION_TARGET_LOCAL_NED";
28213 const EXTRA_CRC: u8 = 143u8;
28214 const ENCODED_LEN: usize = 53usize;
28215 fn deser(
28216 _version: MavlinkVersion,
28217 __input: &[u8],
28218 ) -> Result<Self, ::mavlink_core::error::ParserError> {
28219 let avail_len = __input.len();
28220 let mut payload_buf = [0; Self::ENCODED_LEN];
28221 let mut buf = if avail_len < Self::ENCODED_LEN {
28222 payload_buf[0..avail_len].copy_from_slice(__input);
28223 Bytes::new(&payload_buf)
28224 } else {
28225 Bytes::new(__input)
28226 };
28227 let mut __struct = Self::default();
28228 __struct.time_boot_ms = buf.get_u32_le();
28229 __struct.x = buf.get_f32_le();
28230 __struct.y = buf.get_f32_le();
28231 __struct.z = buf.get_f32_le();
28232 __struct.vx = buf.get_f32_le();
28233 __struct.vy = buf.get_f32_le();
28234 __struct.vz = buf.get_f32_le();
28235 __struct.afx = buf.get_f32_le();
28236 __struct.afy = buf.get_f32_le();
28237 __struct.afz = buf.get_f32_le();
28238 __struct.yaw = buf.get_f32_le();
28239 __struct.yaw_rate = buf.get_f32_le();
28240 let tmp = buf.get_u16_le();
28241 __struct.type_mask =
28242 PositionTargetTypemask::from_bits(tmp as <PositionTargetTypemask as Flags>::Bits)
28243 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
28244 flag_type: "PositionTargetTypemask",
28245 value: tmp as u64,
28246 })?;
28247 __struct.target_system = buf.get_u8();
28248 __struct.target_component = buf.get_u8();
28249 let tmp = buf.get_u8();
28250 __struct.coordinate_frame =
28251 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
28252 enum_type: "MavFrame",
28253 value: tmp as u64,
28254 })?;
28255 Ok(__struct)
28256 }
28257 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
28258 let mut __tmp = BytesMut::new(bytes);
28259 #[allow(clippy::absurd_extreme_comparisons)]
28260 #[allow(unused_comparisons)]
28261 if __tmp.remaining() < Self::ENCODED_LEN {
28262 panic!(
28263 "buffer is too small (need {} bytes, but got {})",
28264 Self::ENCODED_LEN,
28265 __tmp.remaining(),
28266 )
28267 }
28268 __tmp.put_u32_le(self.time_boot_ms);
28269 __tmp.put_f32_le(self.x);
28270 __tmp.put_f32_le(self.y);
28271 __tmp.put_f32_le(self.z);
28272 __tmp.put_f32_le(self.vx);
28273 __tmp.put_f32_le(self.vy);
28274 __tmp.put_f32_le(self.vz);
28275 __tmp.put_f32_le(self.afx);
28276 __tmp.put_f32_le(self.afy);
28277 __tmp.put_f32_le(self.afz);
28278 __tmp.put_f32_le(self.yaw);
28279 __tmp.put_f32_le(self.yaw_rate);
28280 __tmp.put_u16_le(self.type_mask.bits() as u16);
28281 __tmp.put_u8(self.target_system);
28282 __tmp.put_u8(self.target_component);
28283 __tmp.put_u8(self.coordinate_frame as u8);
28284 if matches!(version, MavlinkVersion::V2) {
28285 let len = __tmp.len();
28286 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
28287 } else {
28288 __tmp.len()
28289 }
28290 }
28291}
28292#[doc = "Status of simulation environment, if used."]
28293#[doc = ""]
28294#[doc = "ID: 108"]
28295#[derive(Debug, Clone, PartialEq)]
28296#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
28297#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
28298#[cfg_attr(feature = "ts", derive(TS))]
28299#[cfg_attr(feature = "ts", ts(export))]
28300pub struct SIM_STATE_DATA {
28301 #[doc = "True attitude quaternion component 1, w (1 in null-rotation)"]
28302 pub q1: f32,
28303 #[doc = "True attitude quaternion component 2, x (0 in null-rotation)"]
28304 pub q2: f32,
28305 #[doc = "True attitude quaternion component 3, y (0 in null-rotation)"]
28306 pub q3: f32,
28307 #[doc = "True attitude quaternion component 4, z (0 in null-rotation)"]
28308 pub q4: f32,
28309 #[doc = "Attitude roll expressed as Euler angles, not recommended except for human-readable outputs"]
28310 pub roll: f32,
28311 #[doc = "Attitude pitch expressed as Euler angles, not recommended except for human-readable outputs"]
28312 pub pitch: f32,
28313 #[doc = "Attitude yaw expressed as Euler angles, not recommended except for human-readable outputs"]
28314 pub yaw: f32,
28315 #[doc = "X acceleration"]
28316 pub xacc: f32,
28317 #[doc = "Y acceleration"]
28318 pub yacc: f32,
28319 #[doc = "Z acceleration"]
28320 pub zacc: f32,
28321 #[doc = "Angular speed around X axis"]
28322 pub xgyro: f32,
28323 #[doc = "Angular speed around Y axis"]
28324 pub ygyro: f32,
28325 #[doc = "Angular speed around Z axis"]
28326 pub zgyro: f32,
28327 #[doc = "Latitude (lower precision). Both this and the lat_int field should be set."]
28328 pub lat: f32,
28329 #[doc = "Longitude (lower precision). Both this and the lon_int field should be set."]
28330 pub lon: f32,
28331 #[doc = "Altitude"]
28332 pub alt: f32,
28333 #[doc = "Horizontal position standard deviation"]
28334 pub std_dev_horz: f32,
28335 #[doc = "Vertical position standard deviation"]
28336 pub std_dev_vert: f32,
28337 #[doc = "True velocity in north direction in earth-fixed NED frame"]
28338 pub vn: f32,
28339 #[doc = "True velocity in east direction in earth-fixed NED frame"]
28340 pub ve: f32,
28341 #[doc = "True velocity in down direction in earth-fixed NED frame"]
28342 pub vd: f32,
28343 #[doc = "Latitude (higher precision). If 0, recipients should use the lat field value (otherwise this field is preferred)."]
28344 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
28345 pub lat_int: i32,
28346 #[doc = "Longitude (higher precision). If 0, recipients should use the lon field value (otherwise this field is preferred)."]
28347 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
28348 pub lon_int: i32,
28349}
28350impl SIM_STATE_DATA {
28351 pub const ENCODED_LEN: usize = 92usize;
28352 pub const DEFAULT: Self = Self {
28353 q1: 0.0_f32,
28354 q2: 0.0_f32,
28355 q3: 0.0_f32,
28356 q4: 0.0_f32,
28357 roll: 0.0_f32,
28358 pitch: 0.0_f32,
28359 yaw: 0.0_f32,
28360 xacc: 0.0_f32,
28361 yacc: 0.0_f32,
28362 zacc: 0.0_f32,
28363 xgyro: 0.0_f32,
28364 ygyro: 0.0_f32,
28365 zgyro: 0.0_f32,
28366 lat: 0.0_f32,
28367 lon: 0.0_f32,
28368 alt: 0.0_f32,
28369 std_dev_horz: 0.0_f32,
28370 std_dev_vert: 0.0_f32,
28371 vn: 0.0_f32,
28372 ve: 0.0_f32,
28373 vd: 0.0_f32,
28374 lat_int: 0_i32,
28375 lon_int: 0_i32,
28376 };
28377 #[cfg(feature = "arbitrary")]
28378 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
28379 use arbitrary::{Arbitrary, Unstructured};
28380 let mut buf = [0u8; 1024];
28381 rng.fill_bytes(&mut buf);
28382 let mut unstructured = Unstructured::new(&buf);
28383 Self::arbitrary(&mut unstructured).unwrap_or_default()
28384 }
28385}
28386impl Default for SIM_STATE_DATA {
28387 fn default() -> Self {
28388 Self::DEFAULT.clone()
28389 }
28390}
28391impl MessageData for SIM_STATE_DATA {
28392 type Message = MavMessage;
28393 const ID: u32 = 108u32;
28394 const NAME: &'static str = "SIM_STATE";
28395 const EXTRA_CRC: u8 = 32u8;
28396 const ENCODED_LEN: usize = 92usize;
28397 fn deser(
28398 _version: MavlinkVersion,
28399 __input: &[u8],
28400 ) -> Result<Self, ::mavlink_core::error::ParserError> {
28401 let avail_len = __input.len();
28402 let mut payload_buf = [0; Self::ENCODED_LEN];
28403 let mut buf = if avail_len < Self::ENCODED_LEN {
28404 payload_buf[0..avail_len].copy_from_slice(__input);
28405 Bytes::new(&payload_buf)
28406 } else {
28407 Bytes::new(__input)
28408 };
28409 let mut __struct = Self::default();
28410 __struct.q1 = buf.get_f32_le();
28411 __struct.q2 = buf.get_f32_le();
28412 __struct.q3 = buf.get_f32_le();
28413 __struct.q4 = buf.get_f32_le();
28414 __struct.roll = buf.get_f32_le();
28415 __struct.pitch = buf.get_f32_le();
28416 __struct.yaw = buf.get_f32_le();
28417 __struct.xacc = buf.get_f32_le();
28418 __struct.yacc = buf.get_f32_le();
28419 __struct.zacc = buf.get_f32_le();
28420 __struct.xgyro = buf.get_f32_le();
28421 __struct.ygyro = buf.get_f32_le();
28422 __struct.zgyro = buf.get_f32_le();
28423 __struct.lat = buf.get_f32_le();
28424 __struct.lon = buf.get_f32_le();
28425 __struct.alt = buf.get_f32_le();
28426 __struct.std_dev_horz = buf.get_f32_le();
28427 __struct.std_dev_vert = buf.get_f32_le();
28428 __struct.vn = buf.get_f32_le();
28429 __struct.ve = buf.get_f32_le();
28430 __struct.vd = buf.get_f32_le();
28431 __struct.lat_int = buf.get_i32_le();
28432 __struct.lon_int = buf.get_i32_le();
28433 Ok(__struct)
28434 }
28435 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
28436 let mut __tmp = BytesMut::new(bytes);
28437 #[allow(clippy::absurd_extreme_comparisons)]
28438 #[allow(unused_comparisons)]
28439 if __tmp.remaining() < Self::ENCODED_LEN {
28440 panic!(
28441 "buffer is too small (need {} bytes, but got {})",
28442 Self::ENCODED_LEN,
28443 __tmp.remaining(),
28444 )
28445 }
28446 __tmp.put_f32_le(self.q1);
28447 __tmp.put_f32_le(self.q2);
28448 __tmp.put_f32_le(self.q3);
28449 __tmp.put_f32_le(self.q4);
28450 __tmp.put_f32_le(self.roll);
28451 __tmp.put_f32_le(self.pitch);
28452 __tmp.put_f32_le(self.yaw);
28453 __tmp.put_f32_le(self.xacc);
28454 __tmp.put_f32_le(self.yacc);
28455 __tmp.put_f32_le(self.zacc);
28456 __tmp.put_f32_le(self.xgyro);
28457 __tmp.put_f32_le(self.ygyro);
28458 __tmp.put_f32_le(self.zgyro);
28459 __tmp.put_f32_le(self.lat);
28460 __tmp.put_f32_le(self.lon);
28461 __tmp.put_f32_le(self.alt);
28462 __tmp.put_f32_le(self.std_dev_horz);
28463 __tmp.put_f32_le(self.std_dev_vert);
28464 __tmp.put_f32_le(self.vn);
28465 __tmp.put_f32_le(self.ve);
28466 __tmp.put_f32_le(self.vd);
28467 if matches!(version, MavlinkVersion::V2) {
28468 __tmp.put_i32_le(self.lat_int);
28469 __tmp.put_i32_le(self.lon_int);
28470 let len = __tmp.len();
28471 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
28472 } else {
28473 __tmp.len()
28474 }
28475 }
28476}
28477#[deprecated = "The BATTERY_INFO message is better aligned with UAVCAN messages, and in any case is useful even if a battery is not \"smart\". See `BATTERY_INFO` (Deprecated since 2024-02)"]
28478#[doc = "Smart Battery information (static/infrequent update). Use for updates from: smart battery to flight stack, flight stack to GCS. Use BATTERY_STATUS for the frequent battery updates."]
28479#[doc = ""]
28480#[doc = "ID: 370"]
28481#[derive(Debug, Clone, PartialEq)]
28482#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
28483#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
28484#[cfg_attr(feature = "ts", derive(TS))]
28485#[cfg_attr(feature = "ts", ts(export))]
28486pub struct SMART_BATTERY_INFO_DATA {
28487 #[doc = "Capacity when full according to manufacturer, -1: field not provided."]
28488 pub capacity_full_specification: i32,
28489 #[doc = "Capacity when full (accounting for battery degradation), -1: field not provided."]
28490 pub capacity_full: i32,
28491 #[doc = "Charge/discharge cycle count. UINT16_MAX: field not provided."]
28492 pub cycle_count: u16,
28493 #[doc = "Battery weight. 0: field not provided."]
28494 pub weight: u16,
28495 #[doc = "Minimum per-cell voltage when discharging. If not supplied set to UINT16_MAX value."]
28496 pub discharge_minimum_voltage: u16,
28497 #[doc = "Minimum per-cell voltage when charging. If not supplied set to UINT16_MAX value."]
28498 pub charging_minimum_voltage: u16,
28499 #[doc = "Minimum per-cell voltage when resting. If not supplied set to UINT16_MAX value."]
28500 pub resting_minimum_voltage: u16,
28501 #[doc = "Battery ID"]
28502 pub id: u8,
28503 #[doc = "Function of the battery"]
28504 pub battery_function: MavBatteryFunction,
28505 #[doc = "Type (chemistry) of the battery"]
28506 pub mavtype: MavBatteryType,
28507 #[doc = "Serial number in ASCII characters, 0 terminated. All 0: field not provided."]
28508 #[cfg_attr(feature = "ts", ts(type = "string"))]
28509 pub serial_number: CharArray<16>,
28510 #[doc = "Static device name in ASCII characters, 0 terminated. All 0: field not provided. Encode as manufacturer name then product name separated using an underscore."]
28511 #[cfg_attr(feature = "ts", ts(type = "string"))]
28512 pub device_name: CharArray<50>,
28513 #[doc = "Maximum per-cell voltage when charged. 0: field not provided."]
28514 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
28515 pub charging_maximum_voltage: u16,
28516 #[doc = "Number of battery cells in series. 0: field not provided."]
28517 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
28518 pub cells_in_series: u8,
28519 #[doc = "Maximum pack discharge current. 0: field not provided."]
28520 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
28521 pub discharge_maximum_current: u32,
28522 #[doc = "Maximum pack discharge burst current. 0: field not provided."]
28523 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
28524 pub discharge_maximum_burst_current: u32,
28525 #[doc = "Manufacture date (DD/MM/YYYY) in ASCII characters, 0 terminated. All 0: field not provided."]
28526 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
28527 #[cfg_attr(feature = "ts", ts(type = "string"))]
28528 pub manufacture_date: CharArray<11>,
28529}
28530impl SMART_BATTERY_INFO_DATA {
28531 pub const ENCODED_LEN: usize = 109usize;
28532 pub const DEFAULT: Self = Self {
28533 capacity_full_specification: 0_i32,
28534 capacity_full: 0_i32,
28535 cycle_count: 0_u16,
28536 weight: 0_u16,
28537 discharge_minimum_voltage: 0_u16,
28538 charging_minimum_voltage: 0_u16,
28539 resting_minimum_voltage: 0_u16,
28540 id: 0_u8,
28541 battery_function: MavBatteryFunction::DEFAULT,
28542 mavtype: MavBatteryType::DEFAULT,
28543 serial_number: CharArray::new([0_u8; 16usize]),
28544 device_name: CharArray::new([0_u8; 50usize]),
28545 charging_maximum_voltage: 0_u16,
28546 cells_in_series: 0_u8,
28547 discharge_maximum_current: 0_u32,
28548 discharge_maximum_burst_current: 0_u32,
28549 manufacture_date: CharArray::new([0_u8; 11usize]),
28550 };
28551 #[cfg(feature = "arbitrary")]
28552 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
28553 use arbitrary::{Arbitrary, Unstructured};
28554 let mut buf = [0u8; 1024];
28555 rng.fill_bytes(&mut buf);
28556 let mut unstructured = Unstructured::new(&buf);
28557 Self::arbitrary(&mut unstructured).unwrap_or_default()
28558 }
28559}
28560impl Default for SMART_BATTERY_INFO_DATA {
28561 fn default() -> Self {
28562 Self::DEFAULT.clone()
28563 }
28564}
28565impl MessageData for SMART_BATTERY_INFO_DATA {
28566 type Message = MavMessage;
28567 const ID: u32 = 370u32;
28568 const NAME: &'static str = "SMART_BATTERY_INFO";
28569 const EXTRA_CRC: u8 = 75u8;
28570 const ENCODED_LEN: usize = 109usize;
28571 fn deser(
28572 _version: MavlinkVersion,
28573 __input: &[u8],
28574 ) -> Result<Self, ::mavlink_core::error::ParserError> {
28575 let avail_len = __input.len();
28576 let mut payload_buf = [0; Self::ENCODED_LEN];
28577 let mut buf = if avail_len < Self::ENCODED_LEN {
28578 payload_buf[0..avail_len].copy_from_slice(__input);
28579 Bytes::new(&payload_buf)
28580 } else {
28581 Bytes::new(__input)
28582 };
28583 let mut __struct = Self::default();
28584 __struct.capacity_full_specification = buf.get_i32_le();
28585 __struct.capacity_full = buf.get_i32_le();
28586 __struct.cycle_count = buf.get_u16_le();
28587 __struct.weight = buf.get_u16_le();
28588 __struct.discharge_minimum_voltage = buf.get_u16_le();
28589 __struct.charging_minimum_voltage = buf.get_u16_le();
28590 __struct.resting_minimum_voltage = buf.get_u16_le();
28591 __struct.id = buf.get_u8();
28592 let tmp = buf.get_u8();
28593 __struct.battery_function =
28594 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
28595 enum_type: "MavBatteryFunction",
28596 value: tmp as u64,
28597 })?;
28598 let tmp = buf.get_u8();
28599 __struct.mavtype =
28600 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
28601 enum_type: "MavBatteryType",
28602 value: tmp as u64,
28603 })?;
28604 let mut tmp = [0_u8; 16usize];
28605 for v in &mut tmp {
28606 *v = buf.get_u8();
28607 }
28608 __struct.serial_number = CharArray::new(tmp);
28609 let mut tmp = [0_u8; 50usize];
28610 for v in &mut tmp {
28611 *v = buf.get_u8();
28612 }
28613 __struct.device_name = CharArray::new(tmp);
28614 __struct.charging_maximum_voltage = buf.get_u16_le();
28615 __struct.cells_in_series = buf.get_u8();
28616 __struct.discharge_maximum_current = buf.get_u32_le();
28617 __struct.discharge_maximum_burst_current = buf.get_u32_le();
28618 let mut tmp = [0_u8; 11usize];
28619 for v in &mut tmp {
28620 *v = buf.get_u8();
28621 }
28622 __struct.manufacture_date = CharArray::new(tmp);
28623 Ok(__struct)
28624 }
28625 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
28626 let mut __tmp = BytesMut::new(bytes);
28627 #[allow(clippy::absurd_extreme_comparisons)]
28628 #[allow(unused_comparisons)]
28629 if __tmp.remaining() < Self::ENCODED_LEN {
28630 panic!(
28631 "buffer is too small (need {} bytes, but got {})",
28632 Self::ENCODED_LEN,
28633 __tmp.remaining(),
28634 )
28635 }
28636 __tmp.put_i32_le(self.capacity_full_specification);
28637 __tmp.put_i32_le(self.capacity_full);
28638 __tmp.put_u16_le(self.cycle_count);
28639 __tmp.put_u16_le(self.weight);
28640 __tmp.put_u16_le(self.discharge_minimum_voltage);
28641 __tmp.put_u16_le(self.charging_minimum_voltage);
28642 __tmp.put_u16_le(self.resting_minimum_voltage);
28643 __tmp.put_u8(self.id);
28644 __tmp.put_u8(self.battery_function as u8);
28645 __tmp.put_u8(self.mavtype as u8);
28646 for val in &self.serial_number {
28647 __tmp.put_u8(*val);
28648 }
28649 for val in &self.device_name {
28650 __tmp.put_u8(*val);
28651 }
28652 if matches!(version, MavlinkVersion::V2) {
28653 __tmp.put_u16_le(self.charging_maximum_voltage);
28654 __tmp.put_u8(self.cells_in_series);
28655 __tmp.put_u32_le(self.discharge_maximum_current);
28656 __tmp.put_u32_le(self.discharge_maximum_burst_current);
28657 for val in &self.manufacture_date {
28658 __tmp.put_u8(*val);
28659 }
28660 let len = __tmp.len();
28661 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
28662 } else {
28663 __tmp.len()
28664 }
28665 }
28666}
28667#[doc = "Status text message. These messages are printed in yellow in the COMM console of QGroundControl. WARNING: They consume quite some bandwidth, so use only for important status and error messages. If implemented wisely, these messages are buffered on the MCU and sent only at a limited rate (e.g. 10 Hz)."]
28668#[doc = ""]
28669#[doc = "ID: 253"]
28670#[derive(Debug, Clone, PartialEq)]
28671#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
28672#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
28673#[cfg_attr(feature = "ts", derive(TS))]
28674#[cfg_attr(feature = "ts", ts(export))]
28675pub struct STATUSTEXT_DATA {
28676 #[doc = "Severity of status. Relies on the definitions within RFC-5424."]
28677 pub severity: MavSeverity,
28678 #[doc = "Status text message, without null termination character"]
28679 #[cfg_attr(feature = "ts", ts(type = "string"))]
28680 pub text: CharArray<50>,
28681 #[doc = "Unique (opaque) identifier for this statustext message. May be used to reassemble a logical long-statustext message from a sequence of chunks. A value of zero indicates this is the only chunk in the sequence and the message can be emitted immediately."]
28682 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
28683 pub id: u16,
28684 #[doc = "This chunk's sequence number; indexing is from zero. Any null character in the text field is taken to mean this was the last chunk."]
28685 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
28686 pub chunk_seq: u8,
28687}
28688impl STATUSTEXT_DATA {
28689 pub const ENCODED_LEN: usize = 54usize;
28690 pub const DEFAULT: Self = Self {
28691 severity: MavSeverity::DEFAULT,
28692 text: CharArray::new([0_u8; 50usize]),
28693 id: 0_u16,
28694 chunk_seq: 0_u8,
28695 };
28696 #[cfg(feature = "arbitrary")]
28697 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
28698 use arbitrary::{Arbitrary, Unstructured};
28699 let mut buf = [0u8; 1024];
28700 rng.fill_bytes(&mut buf);
28701 let mut unstructured = Unstructured::new(&buf);
28702 Self::arbitrary(&mut unstructured).unwrap_or_default()
28703 }
28704}
28705impl Default for STATUSTEXT_DATA {
28706 fn default() -> Self {
28707 Self::DEFAULT.clone()
28708 }
28709}
28710impl MessageData for STATUSTEXT_DATA {
28711 type Message = MavMessage;
28712 const ID: u32 = 253u32;
28713 const NAME: &'static str = "STATUSTEXT";
28714 const EXTRA_CRC: u8 = 83u8;
28715 const ENCODED_LEN: usize = 54usize;
28716 fn deser(
28717 _version: MavlinkVersion,
28718 __input: &[u8],
28719 ) -> Result<Self, ::mavlink_core::error::ParserError> {
28720 let avail_len = __input.len();
28721 let mut payload_buf = [0; Self::ENCODED_LEN];
28722 let mut buf = if avail_len < Self::ENCODED_LEN {
28723 payload_buf[0..avail_len].copy_from_slice(__input);
28724 Bytes::new(&payload_buf)
28725 } else {
28726 Bytes::new(__input)
28727 };
28728 let mut __struct = Self::default();
28729 let tmp = buf.get_u8();
28730 __struct.severity =
28731 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
28732 enum_type: "MavSeverity",
28733 value: tmp as u64,
28734 })?;
28735 let mut tmp = [0_u8; 50usize];
28736 for v in &mut tmp {
28737 *v = buf.get_u8();
28738 }
28739 __struct.text = CharArray::new(tmp);
28740 __struct.id = buf.get_u16_le();
28741 __struct.chunk_seq = buf.get_u8();
28742 Ok(__struct)
28743 }
28744 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
28745 let mut __tmp = BytesMut::new(bytes);
28746 #[allow(clippy::absurd_extreme_comparisons)]
28747 #[allow(unused_comparisons)]
28748 if __tmp.remaining() < Self::ENCODED_LEN {
28749 panic!(
28750 "buffer is too small (need {} bytes, but got {})",
28751 Self::ENCODED_LEN,
28752 __tmp.remaining(),
28753 )
28754 }
28755 __tmp.put_u8(self.severity as u8);
28756 for val in &self.text {
28757 __tmp.put_u8(*val);
28758 }
28759 if matches!(version, MavlinkVersion::V2) {
28760 __tmp.put_u16_le(self.id);
28761 __tmp.put_u8(self.chunk_seq);
28762 let len = __tmp.len();
28763 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
28764 } else {
28765 __tmp.len()
28766 }
28767 }
28768}
28769#[doc = "Information about a storage medium. This message is sent in response to a request with MAV_CMD_REQUEST_MESSAGE and whenever the status of the storage changes (STORAGE_STATUS). Use MAV_CMD_REQUEST_MESSAGE.param2 to indicate the index/id of requested storage: 0 for all, 1 for first, 2 for second, etc."]
28770#[doc = ""]
28771#[doc = "ID: 261"]
28772#[derive(Debug, Clone, PartialEq)]
28773#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
28774#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
28775#[cfg_attr(feature = "ts", derive(TS))]
28776#[cfg_attr(feature = "ts", ts(export))]
28777pub struct STORAGE_INFORMATION_DATA {
28778 #[doc = "Timestamp (time since system boot)."]
28779 pub time_boot_ms: u32,
28780 #[doc = "Total capacity. If storage is not ready (STORAGE_STATUS_READY) value will be ignored."]
28781 pub total_capacity: f32,
28782 #[doc = "Used capacity. If storage is not ready (STORAGE_STATUS_READY) value will be ignored."]
28783 pub used_capacity: f32,
28784 #[doc = "Available storage capacity. If storage is not ready (STORAGE_STATUS_READY) value will be ignored."]
28785 pub available_capacity: f32,
28786 #[doc = "Read speed."]
28787 pub read_speed: f32,
28788 #[doc = "Write speed."]
28789 pub write_speed: f32,
28790 #[doc = "Storage ID (1 for first, 2 for second, etc.)"]
28791 pub storage_id: u8,
28792 #[doc = "Number of storage devices"]
28793 pub storage_count: u8,
28794 #[doc = "Status of storage"]
28795 pub status: StorageStatus,
28796 #[doc = "Type of storage"]
28797 #[cfg_attr(feature = "serde", serde(default))]
28798 pub mavtype: StorageType,
28799 #[doc = "Textual storage name to be used in UI (microSD 1, Internal Memory, etc.) This is a NULL terminated string. If it is exactly 32 characters long, add a terminating NULL. If this string is empty, the generic type is shown to the user."]
28800 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
28801 #[cfg_attr(feature = "ts", ts(type = "string"))]
28802 pub name: CharArray<32>,
28803 #[doc = "Flags indicating whether this instance is preferred storage for photos, videos, etc. Note: Implementations should initially set the flags on the system-default storage id used for saving media (if possible/supported). This setting can then be overridden using MAV_CMD_SET_STORAGE_USAGE. If the media usage flags are not set, a GCS may assume storage ID 1 is the default storage for all media types."]
28804 #[cfg_attr(feature = "serde", serde(default))]
28805 pub storage_usage: StorageUsageFlag,
28806}
28807impl STORAGE_INFORMATION_DATA {
28808 pub const ENCODED_LEN: usize = 61usize;
28809 pub const DEFAULT: Self = Self {
28810 time_boot_ms: 0_u32,
28811 total_capacity: 0.0_f32,
28812 used_capacity: 0.0_f32,
28813 available_capacity: 0.0_f32,
28814 read_speed: 0.0_f32,
28815 write_speed: 0.0_f32,
28816 storage_id: 0_u8,
28817 storage_count: 0_u8,
28818 status: StorageStatus::DEFAULT,
28819 mavtype: StorageType::DEFAULT,
28820 name: CharArray::new([0_u8; 32usize]),
28821 storage_usage: StorageUsageFlag::DEFAULT,
28822 };
28823 #[cfg(feature = "arbitrary")]
28824 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
28825 use arbitrary::{Arbitrary, Unstructured};
28826 let mut buf = [0u8; 1024];
28827 rng.fill_bytes(&mut buf);
28828 let mut unstructured = Unstructured::new(&buf);
28829 Self::arbitrary(&mut unstructured).unwrap_or_default()
28830 }
28831}
28832impl Default for STORAGE_INFORMATION_DATA {
28833 fn default() -> Self {
28834 Self::DEFAULT.clone()
28835 }
28836}
28837impl MessageData for STORAGE_INFORMATION_DATA {
28838 type Message = MavMessage;
28839 const ID: u32 = 261u32;
28840 const NAME: &'static str = "STORAGE_INFORMATION";
28841 const EXTRA_CRC: u8 = 179u8;
28842 const ENCODED_LEN: usize = 61usize;
28843 fn deser(
28844 _version: MavlinkVersion,
28845 __input: &[u8],
28846 ) -> Result<Self, ::mavlink_core::error::ParserError> {
28847 let avail_len = __input.len();
28848 let mut payload_buf = [0; Self::ENCODED_LEN];
28849 let mut buf = if avail_len < Self::ENCODED_LEN {
28850 payload_buf[0..avail_len].copy_from_slice(__input);
28851 Bytes::new(&payload_buf)
28852 } else {
28853 Bytes::new(__input)
28854 };
28855 let mut __struct = Self::default();
28856 __struct.time_boot_ms = buf.get_u32_le();
28857 __struct.total_capacity = buf.get_f32_le();
28858 __struct.used_capacity = buf.get_f32_le();
28859 __struct.available_capacity = buf.get_f32_le();
28860 __struct.read_speed = buf.get_f32_le();
28861 __struct.write_speed = buf.get_f32_le();
28862 __struct.storage_id = buf.get_u8();
28863 __struct.storage_count = buf.get_u8();
28864 let tmp = buf.get_u8();
28865 __struct.status =
28866 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
28867 enum_type: "StorageStatus",
28868 value: tmp as u64,
28869 })?;
28870 let tmp = buf.get_u8();
28871 __struct.mavtype =
28872 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
28873 enum_type: "StorageType",
28874 value: tmp as u64,
28875 })?;
28876 let mut tmp = [0_u8; 32usize];
28877 for v in &mut tmp {
28878 *v = buf.get_u8();
28879 }
28880 __struct.name = CharArray::new(tmp);
28881 let tmp = buf.get_u8();
28882 __struct.storage_usage = StorageUsageFlag::from_bits(
28883 tmp as <StorageUsageFlag as Flags>::Bits,
28884 )
28885 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
28886 flag_type: "StorageUsageFlag",
28887 value: tmp as u64,
28888 })?;
28889 Ok(__struct)
28890 }
28891 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
28892 let mut __tmp = BytesMut::new(bytes);
28893 #[allow(clippy::absurd_extreme_comparisons)]
28894 #[allow(unused_comparisons)]
28895 if __tmp.remaining() < Self::ENCODED_LEN {
28896 panic!(
28897 "buffer is too small (need {} bytes, but got {})",
28898 Self::ENCODED_LEN,
28899 __tmp.remaining(),
28900 )
28901 }
28902 __tmp.put_u32_le(self.time_boot_ms);
28903 __tmp.put_f32_le(self.total_capacity);
28904 __tmp.put_f32_le(self.used_capacity);
28905 __tmp.put_f32_le(self.available_capacity);
28906 __tmp.put_f32_le(self.read_speed);
28907 __tmp.put_f32_le(self.write_speed);
28908 __tmp.put_u8(self.storage_id);
28909 __tmp.put_u8(self.storage_count);
28910 __tmp.put_u8(self.status as u8);
28911 if matches!(version, MavlinkVersion::V2) {
28912 __tmp.put_u8(self.mavtype as u8);
28913 for val in &self.name {
28914 __tmp.put_u8(*val);
28915 }
28916 __tmp.put_u8(self.storage_usage.bits() as u8);
28917 let len = __tmp.len();
28918 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
28919 } else {
28920 __tmp.len()
28921 }
28922 }
28923}
28924#[doc = "Tune formats supported by vehicle. This should be emitted as response to MAV_CMD_REQUEST_MESSAGE."]
28925#[doc = ""]
28926#[doc = "ID: 401"]
28927#[derive(Debug, Clone, PartialEq)]
28928#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
28929#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
28930#[cfg_attr(feature = "ts", derive(TS))]
28931#[cfg_attr(feature = "ts", ts(export))]
28932pub struct SUPPORTED_TUNES_DATA {
28933 #[doc = "Bitfield of supported tune formats."]
28934 pub format: TuneFormat,
28935 #[doc = "System ID"]
28936 pub target_system: u8,
28937 #[doc = "Component ID"]
28938 pub target_component: u8,
28939}
28940impl SUPPORTED_TUNES_DATA {
28941 pub const ENCODED_LEN: usize = 6usize;
28942 pub const DEFAULT: Self = Self {
28943 format: TuneFormat::DEFAULT,
28944 target_system: 0_u8,
28945 target_component: 0_u8,
28946 };
28947 #[cfg(feature = "arbitrary")]
28948 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
28949 use arbitrary::{Arbitrary, Unstructured};
28950 let mut buf = [0u8; 1024];
28951 rng.fill_bytes(&mut buf);
28952 let mut unstructured = Unstructured::new(&buf);
28953 Self::arbitrary(&mut unstructured).unwrap_or_default()
28954 }
28955}
28956impl Default for SUPPORTED_TUNES_DATA {
28957 fn default() -> Self {
28958 Self::DEFAULT.clone()
28959 }
28960}
28961impl MessageData for SUPPORTED_TUNES_DATA {
28962 type Message = MavMessage;
28963 const ID: u32 = 401u32;
28964 const NAME: &'static str = "SUPPORTED_TUNES";
28965 const EXTRA_CRC: u8 = 183u8;
28966 const ENCODED_LEN: usize = 6usize;
28967 fn deser(
28968 _version: MavlinkVersion,
28969 __input: &[u8],
28970 ) -> Result<Self, ::mavlink_core::error::ParserError> {
28971 let avail_len = __input.len();
28972 let mut payload_buf = [0; Self::ENCODED_LEN];
28973 let mut buf = if avail_len < Self::ENCODED_LEN {
28974 payload_buf[0..avail_len].copy_from_slice(__input);
28975 Bytes::new(&payload_buf)
28976 } else {
28977 Bytes::new(__input)
28978 };
28979 let mut __struct = Self::default();
28980 let tmp = buf.get_u32_le();
28981 __struct.format = FromPrimitive::from_u32(tmp).ok_or(
28982 ::mavlink_core::error::ParserError::InvalidEnum {
28983 enum_type: "TuneFormat",
28984 value: tmp as u64,
28985 },
28986 )?;
28987 __struct.target_system = buf.get_u8();
28988 __struct.target_component = buf.get_u8();
28989 Ok(__struct)
28990 }
28991 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
28992 let mut __tmp = BytesMut::new(bytes);
28993 #[allow(clippy::absurd_extreme_comparisons)]
28994 #[allow(unused_comparisons)]
28995 if __tmp.remaining() < Self::ENCODED_LEN {
28996 panic!(
28997 "buffer is too small (need {} bytes, but got {})",
28998 Self::ENCODED_LEN,
28999 __tmp.remaining(),
29000 )
29001 }
29002 __tmp.put_u32_le(self.format as u32);
29003 __tmp.put_u8(self.target_system);
29004 __tmp.put_u8(self.target_component);
29005 if matches!(version, MavlinkVersion::V2) {
29006 let len = __tmp.len();
29007 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
29008 } else {
29009 __tmp.len()
29010 }
29011 }
29012}
29013#[doc = "The system time is the time of the master clock. This can be emitted by flight controllers, onboard computers, or other components in the MAVLink network. Components that are using a less reliable time source, such as a battery-backed real time clock, can choose to match their system clock to that of a SYSTEM_TYPE that indicates a more recent time. This allows more broadly accurate date stamping of logs, and so on. If precise time synchronization is needed then use TIMESYNC instead."]
29014#[doc = ""]
29015#[doc = "ID: 2"]
29016#[derive(Debug, Clone, PartialEq)]
29017#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
29018#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
29019#[cfg_attr(feature = "ts", derive(TS))]
29020#[cfg_attr(feature = "ts", ts(export))]
29021pub struct SYSTEM_TIME_DATA {
29022 #[doc = "Timestamp (UNIX epoch time)."]
29023 pub time_unix_usec: u64,
29024 #[doc = "Timestamp (time since system boot)."]
29025 pub time_boot_ms: u32,
29026}
29027impl SYSTEM_TIME_DATA {
29028 pub const ENCODED_LEN: usize = 12usize;
29029 pub const DEFAULT: Self = Self {
29030 time_unix_usec: 0_u64,
29031 time_boot_ms: 0_u32,
29032 };
29033 #[cfg(feature = "arbitrary")]
29034 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
29035 use arbitrary::{Arbitrary, Unstructured};
29036 let mut buf = [0u8; 1024];
29037 rng.fill_bytes(&mut buf);
29038 let mut unstructured = Unstructured::new(&buf);
29039 Self::arbitrary(&mut unstructured).unwrap_or_default()
29040 }
29041}
29042impl Default for SYSTEM_TIME_DATA {
29043 fn default() -> Self {
29044 Self::DEFAULT.clone()
29045 }
29046}
29047impl MessageData for SYSTEM_TIME_DATA {
29048 type Message = MavMessage;
29049 const ID: u32 = 2u32;
29050 const NAME: &'static str = "SYSTEM_TIME";
29051 const EXTRA_CRC: u8 = 137u8;
29052 const ENCODED_LEN: usize = 12usize;
29053 fn deser(
29054 _version: MavlinkVersion,
29055 __input: &[u8],
29056 ) -> Result<Self, ::mavlink_core::error::ParserError> {
29057 let avail_len = __input.len();
29058 let mut payload_buf = [0; Self::ENCODED_LEN];
29059 let mut buf = if avail_len < Self::ENCODED_LEN {
29060 payload_buf[0..avail_len].copy_from_slice(__input);
29061 Bytes::new(&payload_buf)
29062 } else {
29063 Bytes::new(__input)
29064 };
29065 let mut __struct = Self::default();
29066 __struct.time_unix_usec = buf.get_u64_le();
29067 __struct.time_boot_ms = buf.get_u32_le();
29068 Ok(__struct)
29069 }
29070 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
29071 let mut __tmp = BytesMut::new(bytes);
29072 #[allow(clippy::absurd_extreme_comparisons)]
29073 #[allow(unused_comparisons)]
29074 if __tmp.remaining() < Self::ENCODED_LEN {
29075 panic!(
29076 "buffer is too small (need {} bytes, but got {})",
29077 Self::ENCODED_LEN,
29078 __tmp.remaining(),
29079 )
29080 }
29081 __tmp.put_u64_le(self.time_unix_usec);
29082 __tmp.put_u32_le(self.time_boot_ms);
29083 if matches!(version, MavlinkVersion::V2) {
29084 let len = __tmp.len();
29085 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
29086 } else {
29087 __tmp.len()
29088 }
29089 }
29090}
29091#[doc = "The general system state. If the system is following the MAVLink standard, the system state is mainly defined by three orthogonal states/modes: The system mode, which is either LOCKED (motors shut down and locked), MANUAL (system under RC control), GUIDED (system with autonomous position control, position setpoint controlled manually) or AUTO (system guided by path/waypoint planner). The NAV_MODE defined the current flight state: LIFTOFF (often an open-loop maneuver), LANDING, WAYPOINTS or VECTOR. This represents the internal navigation state machine. The system status shows whether the system is currently active or not and if an emergency occurred. During the CRITICAL and EMERGENCY states the MAV is still considered to be active, but should start emergency procedures autonomously. After a failure occurred it should first move from active to critical to allow manual intervention and then move to emergency after a certain timeout."]
29092#[doc = ""]
29093#[doc = "ID: 1"]
29094#[derive(Debug, Clone, PartialEq)]
29095#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
29096#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
29097#[cfg_attr(feature = "ts", derive(TS))]
29098#[cfg_attr(feature = "ts", ts(export))]
29099pub struct SYS_STATUS_DATA {
29100 #[doc = "Bitmap showing which onboard controllers and sensors are present. Value of 0: not present. Value of 1: present."]
29101 pub onboard_control_sensors_present: MavSysStatusSensor,
29102 #[doc = "Bitmap showing which onboard controllers and sensors are enabled: Value of 0: not enabled. Value of 1: enabled."]
29103 pub onboard_control_sensors_enabled: MavSysStatusSensor,
29104 #[doc = "Bitmap showing which onboard controllers and sensors have an error (or are operational). Value of 0: error. Value of 1: healthy."]
29105 pub onboard_control_sensors_health: MavSysStatusSensor,
29106 #[doc = "Maximum usage in percent of the mainloop time. Values: [0-1000] - should always be below 1000"]
29107 pub load: u16,
29108 #[doc = "Battery voltage, UINT16_MAX: Voltage not sent by autopilot"]
29109 pub voltage_battery: u16,
29110 #[doc = "Battery current, -1: Current not sent by autopilot"]
29111 pub current_battery: i16,
29112 #[doc = "Communication drop rate, (UART, I2C, SPI, CAN), dropped packets on all links (packets that were corrupted on reception on the MAV)"]
29113 pub drop_rate_comm: u16,
29114 #[doc = "Communication errors (UART, I2C, SPI, CAN), dropped packets on all links (packets that were corrupted on reception on the MAV)"]
29115 pub errors_comm: u16,
29116 #[doc = "Autopilot-specific errors"]
29117 pub errors_count1: u16,
29118 #[doc = "Autopilot-specific errors"]
29119 pub errors_count2: u16,
29120 #[doc = "Autopilot-specific errors"]
29121 pub errors_count3: u16,
29122 #[doc = "Autopilot-specific errors"]
29123 pub errors_count4: u16,
29124 #[doc = "Battery energy remaining, -1: Battery remaining energy not sent by autopilot"]
29125 pub battery_remaining: i8,
29126 #[doc = "Bitmap showing which onboard controllers and sensors are present. Value of 0: not present. Value of 1: present."]
29127 #[cfg_attr(feature = "serde", serde(default))]
29128 pub onboard_control_sensors_present_extended: MavSysStatusSensorExtended,
29129 #[doc = "Bitmap showing which onboard controllers and sensors are enabled: Value of 0: not enabled. Value of 1: enabled."]
29130 #[cfg_attr(feature = "serde", serde(default))]
29131 pub onboard_control_sensors_enabled_extended: MavSysStatusSensorExtended,
29132 #[doc = "Bitmap showing which onboard controllers and sensors have an error (or are operational). Value of 0: error. Value of 1: healthy."]
29133 #[cfg_attr(feature = "serde", serde(default))]
29134 pub onboard_control_sensors_health_extended: MavSysStatusSensorExtended,
29135}
29136impl SYS_STATUS_DATA {
29137 pub const ENCODED_LEN: usize = 43usize;
29138 pub const DEFAULT: Self = Self {
29139 onboard_control_sensors_present: MavSysStatusSensor::DEFAULT,
29140 onboard_control_sensors_enabled: MavSysStatusSensor::DEFAULT,
29141 onboard_control_sensors_health: MavSysStatusSensor::DEFAULT,
29142 load: 0_u16,
29143 voltage_battery: 0_u16,
29144 current_battery: 0_i16,
29145 drop_rate_comm: 0_u16,
29146 errors_comm: 0_u16,
29147 errors_count1: 0_u16,
29148 errors_count2: 0_u16,
29149 errors_count3: 0_u16,
29150 errors_count4: 0_u16,
29151 battery_remaining: 0_i8,
29152 onboard_control_sensors_present_extended: MavSysStatusSensorExtended::DEFAULT,
29153 onboard_control_sensors_enabled_extended: MavSysStatusSensorExtended::DEFAULT,
29154 onboard_control_sensors_health_extended: MavSysStatusSensorExtended::DEFAULT,
29155 };
29156 #[cfg(feature = "arbitrary")]
29157 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
29158 use arbitrary::{Arbitrary, Unstructured};
29159 let mut buf = [0u8; 1024];
29160 rng.fill_bytes(&mut buf);
29161 let mut unstructured = Unstructured::new(&buf);
29162 Self::arbitrary(&mut unstructured).unwrap_or_default()
29163 }
29164}
29165impl Default for SYS_STATUS_DATA {
29166 fn default() -> Self {
29167 Self::DEFAULT.clone()
29168 }
29169}
29170impl MessageData for SYS_STATUS_DATA {
29171 type Message = MavMessage;
29172 const ID: u32 = 1u32;
29173 const NAME: &'static str = "SYS_STATUS";
29174 const EXTRA_CRC: u8 = 124u8;
29175 const ENCODED_LEN: usize = 43usize;
29176 fn deser(
29177 _version: MavlinkVersion,
29178 __input: &[u8],
29179 ) -> Result<Self, ::mavlink_core::error::ParserError> {
29180 let avail_len = __input.len();
29181 let mut payload_buf = [0; Self::ENCODED_LEN];
29182 let mut buf = if avail_len < Self::ENCODED_LEN {
29183 payload_buf[0..avail_len].copy_from_slice(__input);
29184 Bytes::new(&payload_buf)
29185 } else {
29186 Bytes::new(__input)
29187 };
29188 let mut __struct = Self::default();
29189 let tmp = buf.get_u32_le();
29190 __struct.onboard_control_sensors_present = MavSysStatusSensor::from_bits(
29191 tmp as <MavSysStatusSensor as Flags>::Bits,
29192 )
29193 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
29194 flag_type: "MavSysStatusSensor",
29195 value: tmp as u64,
29196 })?;
29197 let tmp = buf.get_u32_le();
29198 __struct.onboard_control_sensors_enabled = MavSysStatusSensor::from_bits(
29199 tmp as <MavSysStatusSensor as Flags>::Bits,
29200 )
29201 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
29202 flag_type: "MavSysStatusSensor",
29203 value: tmp as u64,
29204 })?;
29205 let tmp = buf.get_u32_le();
29206 __struct.onboard_control_sensors_health = MavSysStatusSensor::from_bits(
29207 tmp as <MavSysStatusSensor as Flags>::Bits,
29208 )
29209 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
29210 flag_type: "MavSysStatusSensor",
29211 value: tmp as u64,
29212 })?;
29213 __struct.load = buf.get_u16_le();
29214 __struct.voltage_battery = buf.get_u16_le();
29215 __struct.current_battery = buf.get_i16_le();
29216 __struct.drop_rate_comm = buf.get_u16_le();
29217 __struct.errors_comm = buf.get_u16_le();
29218 __struct.errors_count1 = buf.get_u16_le();
29219 __struct.errors_count2 = buf.get_u16_le();
29220 __struct.errors_count3 = buf.get_u16_le();
29221 __struct.errors_count4 = buf.get_u16_le();
29222 __struct.battery_remaining = buf.get_i8();
29223 let tmp = buf.get_u32_le();
29224 __struct.onboard_control_sensors_present_extended = MavSysStatusSensorExtended::from_bits(
29225 tmp as <MavSysStatusSensorExtended as Flags>::Bits,
29226 )
29227 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
29228 flag_type: "MavSysStatusSensorExtended",
29229 value: tmp as u64,
29230 })?;
29231 let tmp = buf.get_u32_le();
29232 __struct.onboard_control_sensors_enabled_extended = MavSysStatusSensorExtended::from_bits(
29233 tmp as <MavSysStatusSensorExtended as Flags>::Bits,
29234 )
29235 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
29236 flag_type: "MavSysStatusSensorExtended",
29237 value: tmp as u64,
29238 })?;
29239 let tmp = buf.get_u32_le();
29240 __struct.onboard_control_sensors_health_extended = MavSysStatusSensorExtended::from_bits(
29241 tmp as <MavSysStatusSensorExtended as Flags>::Bits,
29242 )
29243 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
29244 flag_type: "MavSysStatusSensorExtended",
29245 value: tmp as u64,
29246 })?;
29247 Ok(__struct)
29248 }
29249 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
29250 let mut __tmp = BytesMut::new(bytes);
29251 #[allow(clippy::absurd_extreme_comparisons)]
29252 #[allow(unused_comparisons)]
29253 if __tmp.remaining() < Self::ENCODED_LEN {
29254 panic!(
29255 "buffer is too small (need {} bytes, but got {})",
29256 Self::ENCODED_LEN,
29257 __tmp.remaining(),
29258 )
29259 }
29260 __tmp.put_u32_le(self.onboard_control_sensors_present.bits() as u32);
29261 __tmp.put_u32_le(self.onboard_control_sensors_enabled.bits() as u32);
29262 __tmp.put_u32_le(self.onboard_control_sensors_health.bits() as u32);
29263 __tmp.put_u16_le(self.load);
29264 __tmp.put_u16_le(self.voltage_battery);
29265 __tmp.put_i16_le(self.current_battery);
29266 __tmp.put_u16_le(self.drop_rate_comm);
29267 __tmp.put_u16_le(self.errors_comm);
29268 __tmp.put_u16_le(self.errors_count1);
29269 __tmp.put_u16_le(self.errors_count2);
29270 __tmp.put_u16_le(self.errors_count3);
29271 __tmp.put_u16_le(self.errors_count4);
29272 __tmp.put_i8(self.battery_remaining);
29273 if matches!(version, MavlinkVersion::V2) {
29274 __tmp.put_u32_le(self.onboard_control_sensors_present_extended.bits() as u32);
29275 __tmp.put_u32_le(self.onboard_control_sensors_enabled_extended.bits() as u32);
29276 __tmp.put_u32_le(self.onboard_control_sensors_health_extended.bits() as u32);
29277 let len = __tmp.len();
29278 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
29279 } else {
29280 __tmp.len()
29281 }
29282 }
29283}
29284#[doc = "Request that the vehicle report terrain height at the given location (expected response is a TERRAIN_REPORT). Used by GCS to check if vehicle has all terrain data needed for a mission."]
29285#[doc = ""]
29286#[doc = "ID: 135"]
29287#[derive(Debug, Clone, PartialEq)]
29288#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
29289#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
29290#[cfg_attr(feature = "ts", derive(TS))]
29291#[cfg_attr(feature = "ts", ts(export))]
29292pub struct TERRAIN_CHECK_DATA {
29293 #[doc = "Latitude"]
29294 pub lat: i32,
29295 #[doc = "Longitude"]
29296 pub lon: i32,
29297}
29298impl TERRAIN_CHECK_DATA {
29299 pub const ENCODED_LEN: usize = 8usize;
29300 pub const DEFAULT: Self = Self {
29301 lat: 0_i32,
29302 lon: 0_i32,
29303 };
29304 #[cfg(feature = "arbitrary")]
29305 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
29306 use arbitrary::{Arbitrary, Unstructured};
29307 let mut buf = [0u8; 1024];
29308 rng.fill_bytes(&mut buf);
29309 let mut unstructured = Unstructured::new(&buf);
29310 Self::arbitrary(&mut unstructured).unwrap_or_default()
29311 }
29312}
29313impl Default for TERRAIN_CHECK_DATA {
29314 fn default() -> Self {
29315 Self::DEFAULT.clone()
29316 }
29317}
29318impl MessageData for TERRAIN_CHECK_DATA {
29319 type Message = MavMessage;
29320 const ID: u32 = 135u32;
29321 const NAME: &'static str = "TERRAIN_CHECK";
29322 const EXTRA_CRC: u8 = 203u8;
29323 const ENCODED_LEN: usize = 8usize;
29324 fn deser(
29325 _version: MavlinkVersion,
29326 __input: &[u8],
29327 ) -> Result<Self, ::mavlink_core::error::ParserError> {
29328 let avail_len = __input.len();
29329 let mut payload_buf = [0; Self::ENCODED_LEN];
29330 let mut buf = if avail_len < Self::ENCODED_LEN {
29331 payload_buf[0..avail_len].copy_from_slice(__input);
29332 Bytes::new(&payload_buf)
29333 } else {
29334 Bytes::new(__input)
29335 };
29336 let mut __struct = Self::default();
29337 __struct.lat = buf.get_i32_le();
29338 __struct.lon = buf.get_i32_le();
29339 Ok(__struct)
29340 }
29341 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
29342 let mut __tmp = BytesMut::new(bytes);
29343 #[allow(clippy::absurd_extreme_comparisons)]
29344 #[allow(unused_comparisons)]
29345 if __tmp.remaining() < Self::ENCODED_LEN {
29346 panic!(
29347 "buffer is too small (need {} bytes, but got {})",
29348 Self::ENCODED_LEN,
29349 __tmp.remaining(),
29350 )
29351 }
29352 __tmp.put_i32_le(self.lat);
29353 __tmp.put_i32_le(self.lon);
29354 if matches!(version, MavlinkVersion::V2) {
29355 let len = __tmp.len();
29356 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
29357 } else {
29358 __tmp.len()
29359 }
29360 }
29361}
29362#[doc = "Terrain data sent from GCS. The lat/lon and grid_spacing must be the same as a lat/lon from a TERRAIN_REQUEST. See terrain protocol docs: <https://mavlink.io/en/services/terrain.html>."]
29363#[doc = ""]
29364#[doc = "ID: 134"]
29365#[derive(Debug, Clone, PartialEq)]
29366#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
29367#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
29368#[cfg_attr(feature = "ts", derive(TS))]
29369#[cfg_attr(feature = "ts", ts(export))]
29370pub struct TERRAIN_DATA_DATA {
29371 #[doc = "Latitude of SW corner of first grid"]
29372 pub lat: i32,
29373 #[doc = "Longitude of SW corner of first grid"]
29374 pub lon: i32,
29375 #[doc = "Grid spacing"]
29376 pub grid_spacing: u16,
29377 #[doc = "Terrain data MSL"]
29378 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
29379 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
29380 pub data: [i16; 16],
29381 #[doc = "bit within the terrain request mask"]
29382 pub gridbit: u8,
29383}
29384impl TERRAIN_DATA_DATA {
29385 pub const ENCODED_LEN: usize = 43usize;
29386 pub const DEFAULT: Self = Self {
29387 lat: 0_i32,
29388 lon: 0_i32,
29389 grid_spacing: 0_u16,
29390 data: [0_i16; 16usize],
29391 gridbit: 0_u8,
29392 };
29393 #[cfg(feature = "arbitrary")]
29394 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
29395 use arbitrary::{Arbitrary, Unstructured};
29396 let mut buf = [0u8; 1024];
29397 rng.fill_bytes(&mut buf);
29398 let mut unstructured = Unstructured::new(&buf);
29399 Self::arbitrary(&mut unstructured).unwrap_or_default()
29400 }
29401}
29402impl Default for TERRAIN_DATA_DATA {
29403 fn default() -> Self {
29404 Self::DEFAULT.clone()
29405 }
29406}
29407impl MessageData for TERRAIN_DATA_DATA {
29408 type Message = MavMessage;
29409 const ID: u32 = 134u32;
29410 const NAME: &'static str = "TERRAIN_DATA";
29411 const EXTRA_CRC: u8 = 229u8;
29412 const ENCODED_LEN: usize = 43usize;
29413 fn deser(
29414 _version: MavlinkVersion,
29415 __input: &[u8],
29416 ) -> Result<Self, ::mavlink_core::error::ParserError> {
29417 let avail_len = __input.len();
29418 let mut payload_buf = [0; Self::ENCODED_LEN];
29419 let mut buf = if avail_len < Self::ENCODED_LEN {
29420 payload_buf[0..avail_len].copy_from_slice(__input);
29421 Bytes::new(&payload_buf)
29422 } else {
29423 Bytes::new(__input)
29424 };
29425 let mut __struct = Self::default();
29426 __struct.lat = buf.get_i32_le();
29427 __struct.lon = buf.get_i32_le();
29428 __struct.grid_spacing = buf.get_u16_le();
29429 for v in &mut __struct.data {
29430 let val = buf.get_i16_le();
29431 *v = val;
29432 }
29433 __struct.gridbit = buf.get_u8();
29434 Ok(__struct)
29435 }
29436 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
29437 let mut __tmp = BytesMut::new(bytes);
29438 #[allow(clippy::absurd_extreme_comparisons)]
29439 #[allow(unused_comparisons)]
29440 if __tmp.remaining() < Self::ENCODED_LEN {
29441 panic!(
29442 "buffer is too small (need {} bytes, but got {})",
29443 Self::ENCODED_LEN,
29444 __tmp.remaining(),
29445 )
29446 }
29447 __tmp.put_i32_le(self.lat);
29448 __tmp.put_i32_le(self.lon);
29449 __tmp.put_u16_le(self.grid_spacing);
29450 for val in &self.data {
29451 __tmp.put_i16_le(*val);
29452 }
29453 __tmp.put_u8(self.gridbit);
29454 if matches!(version, MavlinkVersion::V2) {
29455 let len = __tmp.len();
29456 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
29457 } else {
29458 __tmp.len()
29459 }
29460 }
29461}
29462#[doc = "Streamed from drone to report progress of terrain map download (initiated by TERRAIN_REQUEST), or sent as a response to a TERRAIN_CHECK request. See terrain protocol docs: <https://mavlink.io/en/services/terrain.html>."]
29463#[doc = ""]
29464#[doc = "ID: 136"]
29465#[derive(Debug, Clone, PartialEq)]
29466#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
29467#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
29468#[cfg_attr(feature = "ts", derive(TS))]
29469#[cfg_attr(feature = "ts", ts(export))]
29470pub struct TERRAIN_REPORT_DATA {
29471 #[doc = "Latitude"]
29472 pub lat: i32,
29473 #[doc = "Longitude"]
29474 pub lon: i32,
29475 #[doc = "Terrain height MSL"]
29476 pub terrain_height: f32,
29477 #[doc = "Current vehicle height above lat/lon terrain height"]
29478 pub current_height: f32,
29479 #[doc = "grid spacing (zero if terrain at this location unavailable)"]
29480 pub spacing: u16,
29481 #[doc = "Number of 4x4 terrain blocks waiting to be received or read from disk"]
29482 pub pending: u16,
29483 #[doc = "Number of 4x4 terrain blocks in memory"]
29484 pub loaded: u16,
29485}
29486impl TERRAIN_REPORT_DATA {
29487 pub const ENCODED_LEN: usize = 22usize;
29488 pub const DEFAULT: Self = Self {
29489 lat: 0_i32,
29490 lon: 0_i32,
29491 terrain_height: 0.0_f32,
29492 current_height: 0.0_f32,
29493 spacing: 0_u16,
29494 pending: 0_u16,
29495 loaded: 0_u16,
29496 };
29497 #[cfg(feature = "arbitrary")]
29498 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
29499 use arbitrary::{Arbitrary, Unstructured};
29500 let mut buf = [0u8; 1024];
29501 rng.fill_bytes(&mut buf);
29502 let mut unstructured = Unstructured::new(&buf);
29503 Self::arbitrary(&mut unstructured).unwrap_or_default()
29504 }
29505}
29506impl Default for TERRAIN_REPORT_DATA {
29507 fn default() -> Self {
29508 Self::DEFAULT.clone()
29509 }
29510}
29511impl MessageData for TERRAIN_REPORT_DATA {
29512 type Message = MavMessage;
29513 const ID: u32 = 136u32;
29514 const NAME: &'static str = "TERRAIN_REPORT";
29515 const EXTRA_CRC: u8 = 1u8;
29516 const ENCODED_LEN: usize = 22usize;
29517 fn deser(
29518 _version: MavlinkVersion,
29519 __input: &[u8],
29520 ) -> Result<Self, ::mavlink_core::error::ParserError> {
29521 let avail_len = __input.len();
29522 let mut payload_buf = [0; Self::ENCODED_LEN];
29523 let mut buf = if avail_len < Self::ENCODED_LEN {
29524 payload_buf[0..avail_len].copy_from_slice(__input);
29525 Bytes::new(&payload_buf)
29526 } else {
29527 Bytes::new(__input)
29528 };
29529 let mut __struct = Self::default();
29530 __struct.lat = buf.get_i32_le();
29531 __struct.lon = buf.get_i32_le();
29532 __struct.terrain_height = buf.get_f32_le();
29533 __struct.current_height = buf.get_f32_le();
29534 __struct.spacing = buf.get_u16_le();
29535 __struct.pending = buf.get_u16_le();
29536 __struct.loaded = buf.get_u16_le();
29537 Ok(__struct)
29538 }
29539 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
29540 let mut __tmp = BytesMut::new(bytes);
29541 #[allow(clippy::absurd_extreme_comparisons)]
29542 #[allow(unused_comparisons)]
29543 if __tmp.remaining() < Self::ENCODED_LEN {
29544 panic!(
29545 "buffer is too small (need {} bytes, but got {})",
29546 Self::ENCODED_LEN,
29547 __tmp.remaining(),
29548 )
29549 }
29550 __tmp.put_i32_le(self.lat);
29551 __tmp.put_i32_le(self.lon);
29552 __tmp.put_f32_le(self.terrain_height);
29553 __tmp.put_f32_le(self.current_height);
29554 __tmp.put_u16_le(self.spacing);
29555 __tmp.put_u16_le(self.pending);
29556 __tmp.put_u16_le(self.loaded);
29557 if matches!(version, MavlinkVersion::V2) {
29558 let len = __tmp.len();
29559 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
29560 } else {
29561 __tmp.len()
29562 }
29563 }
29564}
29565#[doc = "Request for terrain data and terrain status. See terrain protocol docs: <https://mavlink.io/en/services/terrain.html>."]
29566#[doc = ""]
29567#[doc = "ID: 133"]
29568#[derive(Debug, Clone, PartialEq)]
29569#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
29570#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
29571#[cfg_attr(feature = "ts", derive(TS))]
29572#[cfg_attr(feature = "ts", ts(export))]
29573pub struct TERRAIN_REQUEST_DATA {
29574 #[doc = "Bitmask of requested 4x4 grids (row major 8x7 array of grids, 56 bits)"]
29575 pub mask: u64,
29576 #[doc = "Latitude of SW corner of first grid"]
29577 pub lat: i32,
29578 #[doc = "Longitude of SW corner of first grid"]
29579 pub lon: i32,
29580 #[doc = "Grid spacing"]
29581 pub grid_spacing: u16,
29582}
29583impl TERRAIN_REQUEST_DATA {
29584 pub const ENCODED_LEN: usize = 18usize;
29585 pub const DEFAULT: Self = Self {
29586 mask: 0_u64,
29587 lat: 0_i32,
29588 lon: 0_i32,
29589 grid_spacing: 0_u16,
29590 };
29591 #[cfg(feature = "arbitrary")]
29592 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
29593 use arbitrary::{Arbitrary, Unstructured};
29594 let mut buf = [0u8; 1024];
29595 rng.fill_bytes(&mut buf);
29596 let mut unstructured = Unstructured::new(&buf);
29597 Self::arbitrary(&mut unstructured).unwrap_or_default()
29598 }
29599}
29600impl Default for TERRAIN_REQUEST_DATA {
29601 fn default() -> Self {
29602 Self::DEFAULT.clone()
29603 }
29604}
29605impl MessageData for TERRAIN_REQUEST_DATA {
29606 type Message = MavMessage;
29607 const ID: u32 = 133u32;
29608 const NAME: &'static str = "TERRAIN_REQUEST";
29609 const EXTRA_CRC: u8 = 6u8;
29610 const ENCODED_LEN: usize = 18usize;
29611 fn deser(
29612 _version: MavlinkVersion,
29613 __input: &[u8],
29614 ) -> Result<Self, ::mavlink_core::error::ParserError> {
29615 let avail_len = __input.len();
29616 let mut payload_buf = [0; Self::ENCODED_LEN];
29617 let mut buf = if avail_len < Self::ENCODED_LEN {
29618 payload_buf[0..avail_len].copy_from_slice(__input);
29619 Bytes::new(&payload_buf)
29620 } else {
29621 Bytes::new(__input)
29622 };
29623 let mut __struct = Self::default();
29624 __struct.mask = buf.get_u64_le();
29625 __struct.lat = buf.get_i32_le();
29626 __struct.lon = buf.get_i32_le();
29627 __struct.grid_spacing = buf.get_u16_le();
29628 Ok(__struct)
29629 }
29630 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
29631 let mut __tmp = BytesMut::new(bytes);
29632 #[allow(clippy::absurd_extreme_comparisons)]
29633 #[allow(unused_comparisons)]
29634 if __tmp.remaining() < Self::ENCODED_LEN {
29635 panic!(
29636 "buffer is too small (need {} bytes, but got {})",
29637 Self::ENCODED_LEN,
29638 __tmp.remaining(),
29639 )
29640 }
29641 __tmp.put_u64_le(self.mask);
29642 __tmp.put_i32_le(self.lat);
29643 __tmp.put_i32_le(self.lon);
29644 __tmp.put_u16_le(self.grid_spacing);
29645 if matches!(version, MavlinkVersion::V2) {
29646 let len = __tmp.len();
29647 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
29648 } else {
29649 __tmp.len()
29650 }
29651 }
29652}
29653#[doc = "Time synchronization message. The message is used for both timesync requests and responses. The request is sent with `ts1=syncing component timestamp` and `tc1=0`, and may be broadcast or targeted to a specific system/component. The response is sent with `ts1=syncing component timestamp` (mirror back unchanged), and `tc1=responding component timestamp`, with the `target_system` and `target_component` set to ids of the original request. Systems can determine if they are receiving a request or response based on the value of `tc`. If the response has `target_system==target_component==0` the remote system has not been updated to use the component IDs and cannot reliably timesync; the requestor may report an error. Timestamps are UNIX Epoch time or time since system boot in nanoseconds (the timestamp format can be inferred by checking for the magnitude of the number; generally it doesn't matter as only the offset is used). The message sequence is repeated numerous times with results being filtered/averaged to estimate the offset. See also: <https://mavlink.io/en/services/timesync.html>."]
29654#[doc = ""]
29655#[doc = "ID: 111"]
29656#[derive(Debug, Clone, PartialEq)]
29657#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
29658#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
29659#[cfg_attr(feature = "ts", derive(TS))]
29660#[cfg_attr(feature = "ts", ts(export))]
29661pub struct TIMESYNC_DATA {
29662 #[doc = "Time sync timestamp 1. Syncing: 0. Responding: Timestamp of responding component."]
29663 pub tc1: i64,
29664 #[doc = "Time sync timestamp 2. Timestamp of syncing component (mirrored in response)."]
29665 pub ts1: i64,
29666 #[doc = "Target system id. Request: 0 (broadcast) or id of specific system. Response must contain system id of the requesting component."]
29667 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
29668 pub target_system: u8,
29669 #[doc = "Target component id. Request: 0 (broadcast) or id of specific component. Response must contain component id of the requesting component."]
29670 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
29671 pub target_component: u8,
29672}
29673impl TIMESYNC_DATA {
29674 pub const ENCODED_LEN: usize = 18usize;
29675 pub const DEFAULT: Self = Self {
29676 tc1: 0_i64,
29677 ts1: 0_i64,
29678 target_system: 0_u8,
29679 target_component: 0_u8,
29680 };
29681 #[cfg(feature = "arbitrary")]
29682 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
29683 use arbitrary::{Arbitrary, Unstructured};
29684 let mut buf = [0u8; 1024];
29685 rng.fill_bytes(&mut buf);
29686 let mut unstructured = Unstructured::new(&buf);
29687 Self::arbitrary(&mut unstructured).unwrap_or_default()
29688 }
29689}
29690impl Default for TIMESYNC_DATA {
29691 fn default() -> Self {
29692 Self::DEFAULT.clone()
29693 }
29694}
29695impl MessageData for TIMESYNC_DATA {
29696 type Message = MavMessage;
29697 const ID: u32 = 111u32;
29698 const NAME: &'static str = "TIMESYNC";
29699 const EXTRA_CRC: u8 = 34u8;
29700 const ENCODED_LEN: usize = 18usize;
29701 fn deser(
29702 _version: MavlinkVersion,
29703 __input: &[u8],
29704 ) -> Result<Self, ::mavlink_core::error::ParserError> {
29705 let avail_len = __input.len();
29706 let mut payload_buf = [0; Self::ENCODED_LEN];
29707 let mut buf = if avail_len < Self::ENCODED_LEN {
29708 payload_buf[0..avail_len].copy_from_slice(__input);
29709 Bytes::new(&payload_buf)
29710 } else {
29711 Bytes::new(__input)
29712 };
29713 let mut __struct = Self::default();
29714 __struct.tc1 = buf.get_i64_le();
29715 __struct.ts1 = buf.get_i64_le();
29716 __struct.target_system = buf.get_u8();
29717 __struct.target_component = buf.get_u8();
29718 Ok(__struct)
29719 }
29720 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
29721 let mut __tmp = BytesMut::new(bytes);
29722 #[allow(clippy::absurd_extreme_comparisons)]
29723 #[allow(unused_comparisons)]
29724 if __tmp.remaining() < Self::ENCODED_LEN {
29725 panic!(
29726 "buffer is too small (need {} bytes, but got {})",
29727 Self::ENCODED_LEN,
29728 __tmp.remaining(),
29729 )
29730 }
29731 __tmp.put_i64_le(self.tc1);
29732 __tmp.put_i64_le(self.ts1);
29733 if matches!(version, MavlinkVersion::V2) {
29734 __tmp.put_u8(self.target_system);
29735 __tmp.put_u8(self.target_component);
29736 let len = __tmp.len();
29737 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
29738 } else {
29739 __tmp.len()
29740 }
29741 }
29742}
29743#[doc = "Time/duration estimates for various events and actions given the current vehicle state and position."]
29744#[doc = ""]
29745#[doc = "ID: 380"]
29746#[derive(Debug, Clone, PartialEq)]
29747#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
29748#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
29749#[cfg_attr(feature = "ts", derive(TS))]
29750#[cfg_attr(feature = "ts", ts(export))]
29751pub struct TIME_ESTIMATE_TO_TARGET_DATA {
29752 #[doc = "Estimated time to complete the vehicle's configured \"safe return\" action from its current position (e.g. RTL, Smart RTL, etc.). -1 indicates that the vehicle is landed, or that no time estimate available."]
29753 pub safe_return: i32,
29754 #[doc = "Estimated time for vehicle to complete the LAND action from its current position. -1 indicates that the vehicle is landed, or that no time estimate available."]
29755 pub land: i32,
29756 #[doc = "Estimated time for reaching/completing the currently active mission item. -1 means no time estimate available."]
29757 pub mission_next_item: i32,
29758 #[doc = "Estimated time for completing the current mission. -1 means no mission active and/or no estimate available."]
29759 pub mission_end: i32,
29760 #[doc = "Estimated time for completing the current commanded action (i.e. Go To, Takeoff, Land, etc.). -1 means no action active and/or no estimate available."]
29761 pub commanded_action: i32,
29762}
29763impl TIME_ESTIMATE_TO_TARGET_DATA {
29764 pub const ENCODED_LEN: usize = 20usize;
29765 pub const DEFAULT: Self = Self {
29766 safe_return: 0_i32,
29767 land: 0_i32,
29768 mission_next_item: 0_i32,
29769 mission_end: 0_i32,
29770 commanded_action: 0_i32,
29771 };
29772 #[cfg(feature = "arbitrary")]
29773 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
29774 use arbitrary::{Arbitrary, Unstructured};
29775 let mut buf = [0u8; 1024];
29776 rng.fill_bytes(&mut buf);
29777 let mut unstructured = Unstructured::new(&buf);
29778 Self::arbitrary(&mut unstructured).unwrap_or_default()
29779 }
29780}
29781impl Default for TIME_ESTIMATE_TO_TARGET_DATA {
29782 fn default() -> Self {
29783 Self::DEFAULT.clone()
29784 }
29785}
29786impl MessageData for TIME_ESTIMATE_TO_TARGET_DATA {
29787 type Message = MavMessage;
29788 const ID: u32 = 380u32;
29789 const NAME: &'static str = "TIME_ESTIMATE_TO_TARGET";
29790 const EXTRA_CRC: u8 = 232u8;
29791 const ENCODED_LEN: usize = 20usize;
29792 fn deser(
29793 _version: MavlinkVersion,
29794 __input: &[u8],
29795 ) -> Result<Self, ::mavlink_core::error::ParserError> {
29796 let avail_len = __input.len();
29797 let mut payload_buf = [0; Self::ENCODED_LEN];
29798 let mut buf = if avail_len < Self::ENCODED_LEN {
29799 payload_buf[0..avail_len].copy_from_slice(__input);
29800 Bytes::new(&payload_buf)
29801 } else {
29802 Bytes::new(__input)
29803 };
29804 let mut __struct = Self::default();
29805 __struct.safe_return = buf.get_i32_le();
29806 __struct.land = buf.get_i32_le();
29807 __struct.mission_next_item = buf.get_i32_le();
29808 __struct.mission_end = buf.get_i32_le();
29809 __struct.commanded_action = buf.get_i32_le();
29810 Ok(__struct)
29811 }
29812 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
29813 let mut __tmp = BytesMut::new(bytes);
29814 #[allow(clippy::absurd_extreme_comparisons)]
29815 #[allow(unused_comparisons)]
29816 if __tmp.remaining() < Self::ENCODED_LEN {
29817 panic!(
29818 "buffer is too small (need {} bytes, but got {})",
29819 Self::ENCODED_LEN,
29820 __tmp.remaining(),
29821 )
29822 }
29823 __tmp.put_i32_le(self.safe_return);
29824 __tmp.put_i32_le(self.land);
29825 __tmp.put_i32_le(self.mission_next_item);
29826 __tmp.put_i32_le(self.mission_end);
29827 __tmp.put_i32_le(self.commanded_action);
29828 if matches!(version, MavlinkVersion::V2) {
29829 let len = __tmp.len();
29830 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
29831 } else {
29832 __tmp.len()
29833 }
29834 }
29835}
29836#[doc = "Describe a trajectory using an array of up-to 5 bezier control points in the local frame (MAV_FRAME_LOCAL_NED)."]
29837#[doc = ""]
29838#[doc = "ID: 333"]
29839#[derive(Debug, Clone, PartialEq)]
29840#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
29841#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
29842#[cfg_attr(feature = "ts", derive(TS))]
29843#[cfg_attr(feature = "ts", ts(export))]
29844pub struct TRAJECTORY_REPRESENTATION_BEZIER_DATA {
29845 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
29846 pub time_usec: u64,
29847 #[doc = "X-coordinate of bezier control points. Set to NaN if not being used"]
29848 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
29849 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
29850 pub pos_x: [f32; 5],
29851 #[doc = "Y-coordinate of bezier control points. Set to NaN if not being used"]
29852 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
29853 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
29854 pub pos_y: [f32; 5],
29855 #[doc = "Z-coordinate of bezier control points. Set to NaN if not being used"]
29856 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
29857 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
29858 pub pos_z: [f32; 5],
29859 #[doc = "Bezier time horizon. Set to NaN if velocity/acceleration should not be incorporated"]
29860 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
29861 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
29862 pub delta: [f32; 5],
29863 #[doc = "Yaw. Set to NaN for unchanged"]
29864 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
29865 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
29866 pub pos_yaw: [f32; 5],
29867 #[doc = "Number of valid control points (up-to 5 points are possible)"]
29868 pub valid_points: u8,
29869}
29870impl TRAJECTORY_REPRESENTATION_BEZIER_DATA {
29871 pub const ENCODED_LEN: usize = 109usize;
29872 pub const DEFAULT: Self = Self {
29873 time_usec: 0_u64,
29874 pos_x: [0.0_f32; 5usize],
29875 pos_y: [0.0_f32; 5usize],
29876 pos_z: [0.0_f32; 5usize],
29877 delta: [0.0_f32; 5usize],
29878 pos_yaw: [0.0_f32; 5usize],
29879 valid_points: 0_u8,
29880 };
29881 #[cfg(feature = "arbitrary")]
29882 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
29883 use arbitrary::{Arbitrary, Unstructured};
29884 let mut buf = [0u8; 1024];
29885 rng.fill_bytes(&mut buf);
29886 let mut unstructured = Unstructured::new(&buf);
29887 Self::arbitrary(&mut unstructured).unwrap_or_default()
29888 }
29889}
29890impl Default for TRAJECTORY_REPRESENTATION_BEZIER_DATA {
29891 fn default() -> Self {
29892 Self::DEFAULT.clone()
29893 }
29894}
29895impl MessageData for TRAJECTORY_REPRESENTATION_BEZIER_DATA {
29896 type Message = MavMessage;
29897 const ID: u32 = 333u32;
29898 const NAME: &'static str = "TRAJECTORY_REPRESENTATION_BEZIER";
29899 const EXTRA_CRC: u8 = 231u8;
29900 const ENCODED_LEN: usize = 109usize;
29901 fn deser(
29902 _version: MavlinkVersion,
29903 __input: &[u8],
29904 ) -> Result<Self, ::mavlink_core::error::ParserError> {
29905 let avail_len = __input.len();
29906 let mut payload_buf = [0; Self::ENCODED_LEN];
29907 let mut buf = if avail_len < Self::ENCODED_LEN {
29908 payload_buf[0..avail_len].copy_from_slice(__input);
29909 Bytes::new(&payload_buf)
29910 } else {
29911 Bytes::new(__input)
29912 };
29913 let mut __struct = Self::default();
29914 __struct.time_usec = buf.get_u64_le();
29915 for v in &mut __struct.pos_x {
29916 let val = buf.get_f32_le();
29917 *v = val;
29918 }
29919 for v in &mut __struct.pos_y {
29920 let val = buf.get_f32_le();
29921 *v = val;
29922 }
29923 for v in &mut __struct.pos_z {
29924 let val = buf.get_f32_le();
29925 *v = val;
29926 }
29927 for v in &mut __struct.delta {
29928 let val = buf.get_f32_le();
29929 *v = val;
29930 }
29931 for v in &mut __struct.pos_yaw {
29932 let val = buf.get_f32_le();
29933 *v = val;
29934 }
29935 __struct.valid_points = buf.get_u8();
29936 Ok(__struct)
29937 }
29938 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
29939 let mut __tmp = BytesMut::new(bytes);
29940 #[allow(clippy::absurd_extreme_comparisons)]
29941 #[allow(unused_comparisons)]
29942 if __tmp.remaining() < Self::ENCODED_LEN {
29943 panic!(
29944 "buffer is too small (need {} bytes, but got {})",
29945 Self::ENCODED_LEN,
29946 __tmp.remaining(),
29947 )
29948 }
29949 __tmp.put_u64_le(self.time_usec);
29950 for val in &self.pos_x {
29951 __tmp.put_f32_le(*val);
29952 }
29953 for val in &self.pos_y {
29954 __tmp.put_f32_le(*val);
29955 }
29956 for val in &self.pos_z {
29957 __tmp.put_f32_le(*val);
29958 }
29959 for val in &self.delta {
29960 __tmp.put_f32_le(*val);
29961 }
29962 for val in &self.pos_yaw {
29963 __tmp.put_f32_le(*val);
29964 }
29965 __tmp.put_u8(self.valid_points);
29966 if matches!(version, MavlinkVersion::V2) {
29967 let len = __tmp.len();
29968 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
29969 } else {
29970 __tmp.len()
29971 }
29972 }
29973}
29974#[doc = "Describe a trajectory using an array of up-to 5 waypoints in the local frame (MAV_FRAME_LOCAL_NED)."]
29975#[doc = ""]
29976#[doc = "ID: 332"]
29977#[derive(Debug, Clone, PartialEq)]
29978#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
29979#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
29980#[cfg_attr(feature = "ts", derive(TS))]
29981#[cfg_attr(feature = "ts", ts(export))]
29982pub struct TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA {
29983 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
29984 pub time_usec: u64,
29985 #[doc = "X-coordinate of waypoint, set to NaN if not being used"]
29986 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
29987 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
29988 pub pos_x: [f32; 5],
29989 #[doc = "Y-coordinate of waypoint, set to NaN if not being used"]
29990 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
29991 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
29992 pub pos_y: [f32; 5],
29993 #[doc = "Z-coordinate of waypoint, set to NaN if not being used"]
29994 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
29995 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
29996 pub pos_z: [f32; 5],
29997 #[doc = "X-velocity of waypoint, set to NaN if not being used"]
29998 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
29999 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
30000 pub vel_x: [f32; 5],
30001 #[doc = "Y-velocity of waypoint, set to NaN if not being used"]
30002 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
30003 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
30004 pub vel_y: [f32; 5],
30005 #[doc = "Z-velocity of waypoint, set to NaN if not being used"]
30006 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
30007 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
30008 pub vel_z: [f32; 5],
30009 #[doc = "X-acceleration of waypoint, set to NaN if not being used"]
30010 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
30011 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
30012 pub acc_x: [f32; 5],
30013 #[doc = "Y-acceleration of waypoint, set to NaN if not being used"]
30014 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
30015 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
30016 pub acc_y: [f32; 5],
30017 #[doc = "Z-acceleration of waypoint, set to NaN if not being used"]
30018 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
30019 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
30020 pub acc_z: [f32; 5],
30021 #[doc = "Yaw angle, set to NaN if not being used"]
30022 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
30023 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
30024 pub pos_yaw: [f32; 5],
30025 #[doc = "Yaw rate, set to NaN if not being used"]
30026 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
30027 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
30028 pub vel_yaw: [f32; 5],
30029 #[doc = "MAV_CMD command id of waypoint, set to UINT16_MAX if not being used."]
30030 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
30031 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
30032 pub command: [u16; 5],
30033 #[doc = "Number of valid points (up-to 5 waypoints are possible)"]
30034 pub valid_points: u8,
30035}
30036impl TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA {
30037 pub const ENCODED_LEN: usize = 239usize;
30038 pub const DEFAULT: Self = Self {
30039 time_usec: 0_u64,
30040 pos_x: [0.0_f32; 5usize],
30041 pos_y: [0.0_f32; 5usize],
30042 pos_z: [0.0_f32; 5usize],
30043 vel_x: [0.0_f32; 5usize],
30044 vel_y: [0.0_f32; 5usize],
30045 vel_z: [0.0_f32; 5usize],
30046 acc_x: [0.0_f32; 5usize],
30047 acc_y: [0.0_f32; 5usize],
30048 acc_z: [0.0_f32; 5usize],
30049 pos_yaw: [0.0_f32; 5usize],
30050 vel_yaw: [0.0_f32; 5usize],
30051 command: [0_u16; 5usize],
30052 valid_points: 0_u8,
30053 };
30054 #[cfg(feature = "arbitrary")]
30055 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
30056 use arbitrary::{Arbitrary, Unstructured};
30057 let mut buf = [0u8; 1024];
30058 rng.fill_bytes(&mut buf);
30059 let mut unstructured = Unstructured::new(&buf);
30060 Self::arbitrary(&mut unstructured).unwrap_or_default()
30061 }
30062}
30063impl Default for TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA {
30064 fn default() -> Self {
30065 Self::DEFAULT.clone()
30066 }
30067}
30068impl MessageData for TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA {
30069 type Message = MavMessage;
30070 const ID: u32 = 332u32;
30071 const NAME: &'static str = "TRAJECTORY_REPRESENTATION_WAYPOINTS";
30072 const EXTRA_CRC: u8 = 236u8;
30073 const ENCODED_LEN: usize = 239usize;
30074 fn deser(
30075 _version: MavlinkVersion,
30076 __input: &[u8],
30077 ) -> Result<Self, ::mavlink_core::error::ParserError> {
30078 let avail_len = __input.len();
30079 let mut payload_buf = [0; Self::ENCODED_LEN];
30080 let mut buf = if avail_len < Self::ENCODED_LEN {
30081 payload_buf[0..avail_len].copy_from_slice(__input);
30082 Bytes::new(&payload_buf)
30083 } else {
30084 Bytes::new(__input)
30085 };
30086 let mut __struct = Self::default();
30087 __struct.time_usec = buf.get_u64_le();
30088 for v in &mut __struct.pos_x {
30089 let val = buf.get_f32_le();
30090 *v = val;
30091 }
30092 for v in &mut __struct.pos_y {
30093 let val = buf.get_f32_le();
30094 *v = val;
30095 }
30096 for v in &mut __struct.pos_z {
30097 let val = buf.get_f32_le();
30098 *v = val;
30099 }
30100 for v in &mut __struct.vel_x {
30101 let val = buf.get_f32_le();
30102 *v = val;
30103 }
30104 for v in &mut __struct.vel_y {
30105 let val = buf.get_f32_le();
30106 *v = val;
30107 }
30108 for v in &mut __struct.vel_z {
30109 let val = buf.get_f32_le();
30110 *v = val;
30111 }
30112 for v in &mut __struct.acc_x {
30113 let val = buf.get_f32_le();
30114 *v = val;
30115 }
30116 for v in &mut __struct.acc_y {
30117 let val = buf.get_f32_le();
30118 *v = val;
30119 }
30120 for v in &mut __struct.acc_z {
30121 let val = buf.get_f32_le();
30122 *v = val;
30123 }
30124 for v in &mut __struct.pos_yaw {
30125 let val = buf.get_f32_le();
30126 *v = val;
30127 }
30128 for v in &mut __struct.vel_yaw {
30129 let val = buf.get_f32_le();
30130 *v = val;
30131 }
30132 for v in &mut __struct.command {
30133 let val = buf.get_u16_le();
30134 *v = val;
30135 }
30136 __struct.valid_points = buf.get_u8();
30137 Ok(__struct)
30138 }
30139 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
30140 let mut __tmp = BytesMut::new(bytes);
30141 #[allow(clippy::absurd_extreme_comparisons)]
30142 #[allow(unused_comparisons)]
30143 if __tmp.remaining() < Self::ENCODED_LEN {
30144 panic!(
30145 "buffer is too small (need {} bytes, but got {})",
30146 Self::ENCODED_LEN,
30147 __tmp.remaining(),
30148 )
30149 }
30150 __tmp.put_u64_le(self.time_usec);
30151 for val in &self.pos_x {
30152 __tmp.put_f32_le(*val);
30153 }
30154 for val in &self.pos_y {
30155 __tmp.put_f32_le(*val);
30156 }
30157 for val in &self.pos_z {
30158 __tmp.put_f32_le(*val);
30159 }
30160 for val in &self.vel_x {
30161 __tmp.put_f32_le(*val);
30162 }
30163 for val in &self.vel_y {
30164 __tmp.put_f32_le(*val);
30165 }
30166 for val in &self.vel_z {
30167 __tmp.put_f32_le(*val);
30168 }
30169 for val in &self.acc_x {
30170 __tmp.put_f32_le(*val);
30171 }
30172 for val in &self.acc_y {
30173 __tmp.put_f32_le(*val);
30174 }
30175 for val in &self.acc_z {
30176 __tmp.put_f32_le(*val);
30177 }
30178 for val in &self.pos_yaw {
30179 __tmp.put_f32_le(*val);
30180 }
30181 for val in &self.vel_yaw {
30182 __tmp.put_f32_le(*val);
30183 }
30184 for val in &self.command {
30185 __tmp.put_u16_le(*val);
30186 }
30187 __tmp.put_u8(self.valid_points);
30188 if matches!(version, MavlinkVersion::V2) {
30189 let len = __tmp.len();
30190 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
30191 } else {
30192 __tmp.len()
30193 }
30194 }
30195}
30196#[doc = "Message for transporting \"arbitrary\" variable-length data from one component to another (broadcast is not forbidden, but discouraged). The encoding of the data is usually extension specific, i.e. determined by the source, and is usually not documented as part of the MAVLink specification."]
30197#[doc = ""]
30198#[doc = "ID: 385"]
30199#[derive(Debug, Clone, PartialEq)]
30200#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
30201#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
30202#[cfg_attr(feature = "ts", derive(TS))]
30203#[cfg_attr(feature = "ts", ts(export))]
30204pub struct TUNNEL_DATA {
30205 #[doc = "A code that identifies the content of the payload (0 for unknown, which is the default). If this code is less than 32768, it is a 'registered' payload type and the corresponding code should be added to the MAV_TUNNEL_PAYLOAD_TYPE enum. Software creators can register blocks of types as needed. Codes greater than 32767 are considered local experiments and should not be checked in to any widely distributed codebase."]
30206 pub payload_type: MavTunnelPayloadType,
30207 #[doc = "System ID (can be 0 for broadcast, but this is discouraged)"]
30208 pub target_system: u8,
30209 #[doc = "Component ID (can be 0 for broadcast, but this is discouraged)"]
30210 pub target_component: u8,
30211 #[doc = "Length of the data transported in payload"]
30212 pub payload_length: u8,
30213 #[doc = "Variable length payload. The payload length is defined by payload_length. The entire content of this block is opaque unless you understand the encoding specified by payload_type."]
30214 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
30215 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
30216 pub payload: [u8; 128],
30217}
30218impl TUNNEL_DATA {
30219 pub const ENCODED_LEN: usize = 133usize;
30220 pub const DEFAULT: Self = Self {
30221 payload_type: MavTunnelPayloadType::DEFAULT,
30222 target_system: 0_u8,
30223 target_component: 0_u8,
30224 payload_length: 0_u8,
30225 payload: [0_u8; 128usize],
30226 };
30227 #[cfg(feature = "arbitrary")]
30228 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
30229 use arbitrary::{Arbitrary, Unstructured};
30230 let mut buf = [0u8; 1024];
30231 rng.fill_bytes(&mut buf);
30232 let mut unstructured = Unstructured::new(&buf);
30233 Self::arbitrary(&mut unstructured).unwrap_or_default()
30234 }
30235}
30236impl Default for TUNNEL_DATA {
30237 fn default() -> Self {
30238 Self::DEFAULT.clone()
30239 }
30240}
30241impl MessageData for TUNNEL_DATA {
30242 type Message = MavMessage;
30243 const ID: u32 = 385u32;
30244 const NAME: &'static str = "TUNNEL";
30245 const EXTRA_CRC: u8 = 147u8;
30246 const ENCODED_LEN: usize = 133usize;
30247 fn deser(
30248 _version: MavlinkVersion,
30249 __input: &[u8],
30250 ) -> Result<Self, ::mavlink_core::error::ParserError> {
30251 let avail_len = __input.len();
30252 let mut payload_buf = [0; Self::ENCODED_LEN];
30253 let mut buf = if avail_len < Self::ENCODED_LEN {
30254 payload_buf[0..avail_len].copy_from_slice(__input);
30255 Bytes::new(&payload_buf)
30256 } else {
30257 Bytes::new(__input)
30258 };
30259 let mut __struct = Self::default();
30260 let tmp = buf.get_u16_le();
30261 __struct.payload_type = FromPrimitive::from_u16(tmp).ok_or(
30262 ::mavlink_core::error::ParserError::InvalidEnum {
30263 enum_type: "MavTunnelPayloadType",
30264 value: tmp as u64,
30265 },
30266 )?;
30267 __struct.target_system = buf.get_u8();
30268 __struct.target_component = buf.get_u8();
30269 __struct.payload_length = buf.get_u8();
30270 for v in &mut __struct.payload {
30271 let val = buf.get_u8();
30272 *v = val;
30273 }
30274 Ok(__struct)
30275 }
30276 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
30277 let mut __tmp = BytesMut::new(bytes);
30278 #[allow(clippy::absurd_extreme_comparisons)]
30279 #[allow(unused_comparisons)]
30280 if __tmp.remaining() < Self::ENCODED_LEN {
30281 panic!(
30282 "buffer is too small (need {} bytes, but got {})",
30283 Self::ENCODED_LEN,
30284 __tmp.remaining(),
30285 )
30286 }
30287 __tmp.put_u16_le(self.payload_type as u16);
30288 __tmp.put_u8(self.target_system);
30289 __tmp.put_u8(self.target_component);
30290 __tmp.put_u8(self.payload_length);
30291 for val in &self.payload {
30292 __tmp.put_u8(*val);
30293 }
30294 if matches!(version, MavlinkVersion::V2) {
30295 let len = __tmp.len();
30296 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
30297 } else {
30298 __tmp.len()
30299 }
30300 }
30301}
30302#[doc = "General information describing a particular UAVCAN node. Please refer to the definition of the UAVCAN service \"uavcan.protocol.GetNodeInfo\" for the background information. This message should be emitted by the system whenever a new node appears online, or an existing node reboots. Additionally, it can be emitted upon request from the other end of the MAVLink channel (see MAV_CMD_UAVCAN_GET_NODE_INFO). It is also not prohibited to emit this message unconditionally at a low frequency. The UAVCAN specification is available at <http://uavcan.org>."]
30303#[doc = ""]
30304#[doc = "ID: 311"]
30305#[derive(Debug, Clone, PartialEq)]
30306#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
30307#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
30308#[cfg_attr(feature = "ts", derive(TS))]
30309#[cfg_attr(feature = "ts", ts(export))]
30310pub struct UAVCAN_NODE_INFO_DATA {
30311 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
30312 pub time_usec: u64,
30313 #[doc = "Time since the start-up of the node."]
30314 pub uptime_sec: u32,
30315 #[doc = "Version control system (VCS) revision identifier (e.g. git short commit hash). 0 if unknown."]
30316 pub sw_vcs_commit: u32,
30317 #[doc = "Node name string. For example, \"sapog.px4.io\"."]
30318 #[cfg_attr(feature = "ts", ts(type = "string"))]
30319 pub name: CharArray<80>,
30320 #[doc = "Hardware major version number."]
30321 pub hw_version_major: u8,
30322 #[doc = "Hardware minor version number."]
30323 pub hw_version_minor: u8,
30324 #[doc = "Hardware unique 128-bit ID."]
30325 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
30326 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
30327 pub hw_unique_id: [u8; 16],
30328 #[doc = "Software major version number."]
30329 pub sw_version_major: u8,
30330 #[doc = "Software minor version number."]
30331 pub sw_version_minor: u8,
30332}
30333impl UAVCAN_NODE_INFO_DATA {
30334 pub const ENCODED_LEN: usize = 116usize;
30335 pub const DEFAULT: Self = Self {
30336 time_usec: 0_u64,
30337 uptime_sec: 0_u32,
30338 sw_vcs_commit: 0_u32,
30339 name: CharArray::new([0_u8; 80usize]),
30340 hw_version_major: 0_u8,
30341 hw_version_minor: 0_u8,
30342 hw_unique_id: [0_u8; 16usize],
30343 sw_version_major: 0_u8,
30344 sw_version_minor: 0_u8,
30345 };
30346 #[cfg(feature = "arbitrary")]
30347 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
30348 use arbitrary::{Arbitrary, Unstructured};
30349 let mut buf = [0u8; 1024];
30350 rng.fill_bytes(&mut buf);
30351 let mut unstructured = Unstructured::new(&buf);
30352 Self::arbitrary(&mut unstructured).unwrap_or_default()
30353 }
30354}
30355impl Default for UAVCAN_NODE_INFO_DATA {
30356 fn default() -> Self {
30357 Self::DEFAULT.clone()
30358 }
30359}
30360impl MessageData for UAVCAN_NODE_INFO_DATA {
30361 type Message = MavMessage;
30362 const ID: u32 = 311u32;
30363 const NAME: &'static str = "UAVCAN_NODE_INFO";
30364 const EXTRA_CRC: u8 = 95u8;
30365 const ENCODED_LEN: usize = 116usize;
30366 fn deser(
30367 _version: MavlinkVersion,
30368 __input: &[u8],
30369 ) -> Result<Self, ::mavlink_core::error::ParserError> {
30370 let avail_len = __input.len();
30371 let mut payload_buf = [0; Self::ENCODED_LEN];
30372 let mut buf = if avail_len < Self::ENCODED_LEN {
30373 payload_buf[0..avail_len].copy_from_slice(__input);
30374 Bytes::new(&payload_buf)
30375 } else {
30376 Bytes::new(__input)
30377 };
30378 let mut __struct = Self::default();
30379 __struct.time_usec = buf.get_u64_le();
30380 __struct.uptime_sec = buf.get_u32_le();
30381 __struct.sw_vcs_commit = buf.get_u32_le();
30382 let mut tmp = [0_u8; 80usize];
30383 for v in &mut tmp {
30384 *v = buf.get_u8();
30385 }
30386 __struct.name = CharArray::new(tmp);
30387 __struct.hw_version_major = buf.get_u8();
30388 __struct.hw_version_minor = buf.get_u8();
30389 for v in &mut __struct.hw_unique_id {
30390 let val = buf.get_u8();
30391 *v = val;
30392 }
30393 __struct.sw_version_major = buf.get_u8();
30394 __struct.sw_version_minor = buf.get_u8();
30395 Ok(__struct)
30396 }
30397 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
30398 let mut __tmp = BytesMut::new(bytes);
30399 #[allow(clippy::absurd_extreme_comparisons)]
30400 #[allow(unused_comparisons)]
30401 if __tmp.remaining() < Self::ENCODED_LEN {
30402 panic!(
30403 "buffer is too small (need {} bytes, but got {})",
30404 Self::ENCODED_LEN,
30405 __tmp.remaining(),
30406 )
30407 }
30408 __tmp.put_u64_le(self.time_usec);
30409 __tmp.put_u32_le(self.uptime_sec);
30410 __tmp.put_u32_le(self.sw_vcs_commit);
30411 for val in &self.name {
30412 __tmp.put_u8(*val);
30413 }
30414 __tmp.put_u8(self.hw_version_major);
30415 __tmp.put_u8(self.hw_version_minor);
30416 for val in &self.hw_unique_id {
30417 __tmp.put_u8(*val);
30418 }
30419 __tmp.put_u8(self.sw_version_major);
30420 __tmp.put_u8(self.sw_version_minor);
30421 if matches!(version, MavlinkVersion::V2) {
30422 let len = __tmp.len();
30423 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
30424 } else {
30425 __tmp.len()
30426 }
30427 }
30428}
30429#[doc = "General status information of an UAVCAN node. Please refer to the definition of the UAVCAN message \"uavcan.protocol.NodeStatus\" for the background information. The UAVCAN specification is available at <http://uavcan.org>."]
30430#[doc = ""]
30431#[doc = "ID: 310"]
30432#[derive(Debug, Clone, PartialEq)]
30433#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
30434#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
30435#[cfg_attr(feature = "ts", derive(TS))]
30436#[cfg_attr(feature = "ts", ts(export))]
30437pub struct UAVCAN_NODE_STATUS_DATA {
30438 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
30439 pub time_usec: u64,
30440 #[doc = "Time since the start-up of the node."]
30441 pub uptime_sec: u32,
30442 #[doc = "Vendor-specific status information."]
30443 pub vendor_specific_status_code: u16,
30444 #[doc = "Generalized node health status."]
30445 pub health: UavcanNodeHealth,
30446 #[doc = "Generalized operating mode."]
30447 pub mode: UavcanNodeMode,
30448 #[doc = "Not used currently."]
30449 pub sub_mode: u8,
30450}
30451impl UAVCAN_NODE_STATUS_DATA {
30452 pub const ENCODED_LEN: usize = 17usize;
30453 pub const DEFAULT: Self = Self {
30454 time_usec: 0_u64,
30455 uptime_sec: 0_u32,
30456 vendor_specific_status_code: 0_u16,
30457 health: UavcanNodeHealth::DEFAULT,
30458 mode: UavcanNodeMode::DEFAULT,
30459 sub_mode: 0_u8,
30460 };
30461 #[cfg(feature = "arbitrary")]
30462 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
30463 use arbitrary::{Arbitrary, Unstructured};
30464 let mut buf = [0u8; 1024];
30465 rng.fill_bytes(&mut buf);
30466 let mut unstructured = Unstructured::new(&buf);
30467 Self::arbitrary(&mut unstructured).unwrap_or_default()
30468 }
30469}
30470impl Default for UAVCAN_NODE_STATUS_DATA {
30471 fn default() -> Self {
30472 Self::DEFAULT.clone()
30473 }
30474}
30475impl MessageData for UAVCAN_NODE_STATUS_DATA {
30476 type Message = MavMessage;
30477 const ID: u32 = 310u32;
30478 const NAME: &'static str = "UAVCAN_NODE_STATUS";
30479 const EXTRA_CRC: u8 = 28u8;
30480 const ENCODED_LEN: usize = 17usize;
30481 fn deser(
30482 _version: MavlinkVersion,
30483 __input: &[u8],
30484 ) -> Result<Self, ::mavlink_core::error::ParserError> {
30485 let avail_len = __input.len();
30486 let mut payload_buf = [0; Self::ENCODED_LEN];
30487 let mut buf = if avail_len < Self::ENCODED_LEN {
30488 payload_buf[0..avail_len].copy_from_slice(__input);
30489 Bytes::new(&payload_buf)
30490 } else {
30491 Bytes::new(__input)
30492 };
30493 let mut __struct = Self::default();
30494 __struct.time_usec = buf.get_u64_le();
30495 __struct.uptime_sec = buf.get_u32_le();
30496 __struct.vendor_specific_status_code = buf.get_u16_le();
30497 let tmp = buf.get_u8();
30498 __struct.health =
30499 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
30500 enum_type: "UavcanNodeHealth",
30501 value: tmp as u64,
30502 })?;
30503 let tmp = buf.get_u8();
30504 __struct.mode =
30505 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
30506 enum_type: "UavcanNodeMode",
30507 value: tmp as u64,
30508 })?;
30509 __struct.sub_mode = buf.get_u8();
30510 Ok(__struct)
30511 }
30512 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
30513 let mut __tmp = BytesMut::new(bytes);
30514 #[allow(clippy::absurd_extreme_comparisons)]
30515 #[allow(unused_comparisons)]
30516 if __tmp.remaining() < Self::ENCODED_LEN {
30517 panic!(
30518 "buffer is too small (need {} bytes, but got {})",
30519 Self::ENCODED_LEN,
30520 __tmp.remaining(),
30521 )
30522 }
30523 __tmp.put_u64_le(self.time_usec);
30524 __tmp.put_u32_le(self.uptime_sec);
30525 __tmp.put_u16_le(self.vendor_specific_status_code);
30526 __tmp.put_u8(self.health as u8);
30527 __tmp.put_u8(self.mode as u8);
30528 __tmp.put_u8(self.sub_mode);
30529 if matches!(version, MavlinkVersion::V2) {
30530 let len = __tmp.len();
30531 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
30532 } else {
30533 __tmp.len()
30534 }
30535 }
30536}
30537#[doc = "The global position resulting from GPS and sensor fusion."]
30538#[doc = ""]
30539#[doc = "ID: 340"]
30540#[derive(Debug, Clone, PartialEq)]
30541#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
30542#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
30543#[cfg_attr(feature = "ts", derive(TS))]
30544#[cfg_attr(feature = "ts", ts(export))]
30545pub struct UTM_GLOBAL_POSITION_DATA {
30546 #[doc = "Time of applicability of position (microseconds since UNIX epoch)."]
30547 pub time: u64,
30548 #[doc = "Latitude (WGS84)"]
30549 pub lat: i32,
30550 #[doc = "Longitude (WGS84)"]
30551 pub lon: i32,
30552 #[doc = "Altitude (WGS84)"]
30553 pub alt: i32,
30554 #[doc = "Altitude above ground"]
30555 pub relative_alt: i32,
30556 #[doc = "Next waypoint, latitude (WGS84)"]
30557 pub next_lat: i32,
30558 #[doc = "Next waypoint, longitude (WGS84)"]
30559 pub next_lon: i32,
30560 #[doc = "Next waypoint, altitude (WGS84)"]
30561 pub next_alt: i32,
30562 #[doc = "Ground X speed (latitude, positive north)"]
30563 pub vx: i16,
30564 #[doc = "Ground Y speed (longitude, positive east)"]
30565 pub vy: i16,
30566 #[doc = "Ground Z speed (altitude, positive down)"]
30567 pub vz: i16,
30568 #[doc = "Horizontal position uncertainty (standard deviation)"]
30569 pub h_acc: u16,
30570 #[doc = "Altitude uncertainty (standard deviation)"]
30571 pub v_acc: u16,
30572 #[doc = "Speed uncertainty (standard deviation)"]
30573 pub vel_acc: u16,
30574 #[doc = "Time until next update. Set to 0 if unknown or in data driven mode."]
30575 pub update_rate: u16,
30576 #[doc = "Unique UAS ID."]
30577 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
30578 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
30579 pub uas_id: [u8; 18],
30580 #[doc = "Flight state"]
30581 pub flight_state: UtmFlightState,
30582 #[doc = "Bitwise OR combination of the data available flags."]
30583 pub flags: UtmDataAvailFlags,
30584}
30585impl UTM_GLOBAL_POSITION_DATA {
30586 pub const ENCODED_LEN: usize = 70usize;
30587 pub const DEFAULT: Self = Self {
30588 time: 0_u64,
30589 lat: 0_i32,
30590 lon: 0_i32,
30591 alt: 0_i32,
30592 relative_alt: 0_i32,
30593 next_lat: 0_i32,
30594 next_lon: 0_i32,
30595 next_alt: 0_i32,
30596 vx: 0_i16,
30597 vy: 0_i16,
30598 vz: 0_i16,
30599 h_acc: 0_u16,
30600 v_acc: 0_u16,
30601 vel_acc: 0_u16,
30602 update_rate: 0_u16,
30603 uas_id: [0_u8; 18usize],
30604 flight_state: UtmFlightState::DEFAULT,
30605 flags: UtmDataAvailFlags::DEFAULT,
30606 };
30607 #[cfg(feature = "arbitrary")]
30608 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
30609 use arbitrary::{Arbitrary, Unstructured};
30610 let mut buf = [0u8; 1024];
30611 rng.fill_bytes(&mut buf);
30612 let mut unstructured = Unstructured::new(&buf);
30613 Self::arbitrary(&mut unstructured).unwrap_or_default()
30614 }
30615}
30616impl Default for UTM_GLOBAL_POSITION_DATA {
30617 fn default() -> Self {
30618 Self::DEFAULT.clone()
30619 }
30620}
30621impl MessageData for UTM_GLOBAL_POSITION_DATA {
30622 type Message = MavMessage;
30623 const ID: u32 = 340u32;
30624 const NAME: &'static str = "UTM_GLOBAL_POSITION";
30625 const EXTRA_CRC: u8 = 99u8;
30626 const ENCODED_LEN: usize = 70usize;
30627 fn deser(
30628 _version: MavlinkVersion,
30629 __input: &[u8],
30630 ) -> Result<Self, ::mavlink_core::error::ParserError> {
30631 let avail_len = __input.len();
30632 let mut payload_buf = [0; Self::ENCODED_LEN];
30633 let mut buf = if avail_len < Self::ENCODED_LEN {
30634 payload_buf[0..avail_len].copy_from_slice(__input);
30635 Bytes::new(&payload_buf)
30636 } else {
30637 Bytes::new(__input)
30638 };
30639 let mut __struct = Self::default();
30640 __struct.time = buf.get_u64_le();
30641 __struct.lat = buf.get_i32_le();
30642 __struct.lon = buf.get_i32_le();
30643 __struct.alt = buf.get_i32_le();
30644 __struct.relative_alt = buf.get_i32_le();
30645 __struct.next_lat = buf.get_i32_le();
30646 __struct.next_lon = buf.get_i32_le();
30647 __struct.next_alt = buf.get_i32_le();
30648 __struct.vx = buf.get_i16_le();
30649 __struct.vy = buf.get_i16_le();
30650 __struct.vz = buf.get_i16_le();
30651 __struct.h_acc = buf.get_u16_le();
30652 __struct.v_acc = buf.get_u16_le();
30653 __struct.vel_acc = buf.get_u16_le();
30654 __struct.update_rate = buf.get_u16_le();
30655 for v in &mut __struct.uas_id {
30656 let val = buf.get_u8();
30657 *v = val;
30658 }
30659 let tmp = buf.get_u8();
30660 __struct.flight_state =
30661 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
30662 enum_type: "UtmFlightState",
30663 value: tmp as u64,
30664 })?;
30665 let tmp = buf.get_u8();
30666 __struct.flags = UtmDataAvailFlags::from_bits(tmp as <UtmDataAvailFlags as Flags>::Bits)
30667 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
30668 flag_type: "UtmDataAvailFlags",
30669 value: tmp as u64,
30670 })?;
30671 Ok(__struct)
30672 }
30673 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
30674 let mut __tmp = BytesMut::new(bytes);
30675 #[allow(clippy::absurd_extreme_comparisons)]
30676 #[allow(unused_comparisons)]
30677 if __tmp.remaining() < Self::ENCODED_LEN {
30678 panic!(
30679 "buffer is too small (need {} bytes, but got {})",
30680 Self::ENCODED_LEN,
30681 __tmp.remaining(),
30682 )
30683 }
30684 __tmp.put_u64_le(self.time);
30685 __tmp.put_i32_le(self.lat);
30686 __tmp.put_i32_le(self.lon);
30687 __tmp.put_i32_le(self.alt);
30688 __tmp.put_i32_le(self.relative_alt);
30689 __tmp.put_i32_le(self.next_lat);
30690 __tmp.put_i32_le(self.next_lon);
30691 __tmp.put_i32_le(self.next_alt);
30692 __tmp.put_i16_le(self.vx);
30693 __tmp.put_i16_le(self.vy);
30694 __tmp.put_i16_le(self.vz);
30695 __tmp.put_u16_le(self.h_acc);
30696 __tmp.put_u16_le(self.v_acc);
30697 __tmp.put_u16_le(self.vel_acc);
30698 __tmp.put_u16_le(self.update_rate);
30699 for val in &self.uas_id {
30700 __tmp.put_u8(*val);
30701 }
30702 __tmp.put_u8(self.flight_state as u8);
30703 __tmp.put_u8(self.flags.bits() as u8);
30704 if matches!(version, MavlinkVersion::V2) {
30705 let len = __tmp.len();
30706 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
30707 } else {
30708 __tmp.len()
30709 }
30710 }
30711}
30712#[doc = "Message implementing parts of the V2 payload specs in V1 frames for transitional support."]
30713#[doc = ""]
30714#[doc = "ID: 248"]
30715#[derive(Debug, Clone, PartialEq)]
30716#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
30717#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
30718#[cfg_attr(feature = "ts", derive(TS))]
30719#[cfg_attr(feature = "ts", ts(export))]
30720pub struct V2_EXTENSION_DATA {
30721 #[doc = "A code that identifies the software component that understands this message (analogous to USB device classes or mime type strings). If this code is less than 32768, it is considered a 'registered' protocol extension and the corresponding entry should be added to <https://github.com/mavlink/mavlink/definition_files/extension_message_ids.xml>. Software creators can register blocks of message IDs as needed (useful for GCS specific metadata, etc...). Message_types greater than 32767 are considered local experiments and should not be checked in to any widely distributed codebase."]
30722 pub message_type: u16,
30723 #[doc = "Network ID (0 for broadcast)"]
30724 pub target_network: u8,
30725 #[doc = "System ID (0 for broadcast)"]
30726 pub target_system: u8,
30727 #[doc = "Component ID (0 for broadcast)"]
30728 pub target_component: u8,
30729 #[doc = "Variable length payload. The length must be encoded in the payload as part of the message_type protocol, e.g. by including the length as payload data, or by terminating the payload data with a non-zero marker. This is required in order to reconstruct zero-terminated payloads that are (or otherwise would be) trimmed by MAVLink 2 empty-byte truncation. The entire content of the payload block is opaque unless you understand the encoding message_type. The particular encoding used can be extension specific and might not always be documented as part of the MAVLink specification."]
30730 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
30731 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
30732 pub payload: [u8; 249],
30733}
30734impl V2_EXTENSION_DATA {
30735 pub const ENCODED_LEN: usize = 254usize;
30736 pub const DEFAULT: Self = Self {
30737 message_type: 0_u16,
30738 target_network: 0_u8,
30739 target_system: 0_u8,
30740 target_component: 0_u8,
30741 payload: [0_u8; 249usize],
30742 };
30743 #[cfg(feature = "arbitrary")]
30744 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
30745 use arbitrary::{Arbitrary, Unstructured};
30746 let mut buf = [0u8; 1024];
30747 rng.fill_bytes(&mut buf);
30748 let mut unstructured = Unstructured::new(&buf);
30749 Self::arbitrary(&mut unstructured).unwrap_or_default()
30750 }
30751}
30752impl Default for V2_EXTENSION_DATA {
30753 fn default() -> Self {
30754 Self::DEFAULT.clone()
30755 }
30756}
30757impl MessageData for V2_EXTENSION_DATA {
30758 type Message = MavMessage;
30759 const ID: u32 = 248u32;
30760 const NAME: &'static str = "V2_EXTENSION";
30761 const EXTRA_CRC: u8 = 8u8;
30762 const ENCODED_LEN: usize = 254usize;
30763 fn deser(
30764 _version: MavlinkVersion,
30765 __input: &[u8],
30766 ) -> Result<Self, ::mavlink_core::error::ParserError> {
30767 let avail_len = __input.len();
30768 let mut payload_buf = [0; Self::ENCODED_LEN];
30769 let mut buf = if avail_len < Self::ENCODED_LEN {
30770 payload_buf[0..avail_len].copy_from_slice(__input);
30771 Bytes::new(&payload_buf)
30772 } else {
30773 Bytes::new(__input)
30774 };
30775 let mut __struct = Self::default();
30776 __struct.message_type = buf.get_u16_le();
30777 __struct.target_network = buf.get_u8();
30778 __struct.target_system = buf.get_u8();
30779 __struct.target_component = buf.get_u8();
30780 for v in &mut __struct.payload {
30781 let val = buf.get_u8();
30782 *v = val;
30783 }
30784 Ok(__struct)
30785 }
30786 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
30787 let mut __tmp = BytesMut::new(bytes);
30788 #[allow(clippy::absurd_extreme_comparisons)]
30789 #[allow(unused_comparisons)]
30790 if __tmp.remaining() < Self::ENCODED_LEN {
30791 panic!(
30792 "buffer is too small (need {} bytes, but got {})",
30793 Self::ENCODED_LEN,
30794 __tmp.remaining(),
30795 )
30796 }
30797 __tmp.put_u16_le(self.message_type);
30798 __tmp.put_u8(self.target_network);
30799 __tmp.put_u8(self.target_system);
30800 __tmp.put_u8(self.target_component);
30801 for val in &self.payload {
30802 __tmp.put_u8(*val);
30803 }
30804 if matches!(version, MavlinkVersion::V2) {
30805 let len = __tmp.len();
30806 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
30807 } else {
30808 __tmp.len()
30809 }
30810 }
30811}
30812#[doc = "Metrics typically displayed on a HUD for fixed wing aircraft."]
30813#[doc = ""]
30814#[doc = "ID: 74"]
30815#[derive(Debug, Clone, PartialEq)]
30816#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
30817#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
30818#[cfg_attr(feature = "ts", derive(TS))]
30819#[cfg_attr(feature = "ts", ts(export))]
30820pub struct VFR_HUD_DATA {
30821 #[doc = "Vehicle speed in form appropriate for vehicle type. For standard aircraft this is typically calibrated airspeed (CAS) or indicated airspeed (IAS) - either of which can be used by a pilot to estimate stall speed."]
30822 pub airspeed: f32,
30823 #[doc = "Current ground speed."]
30824 pub groundspeed: f32,
30825 #[doc = "Current altitude (MSL)."]
30826 pub alt: f32,
30827 #[doc = "Current climb rate."]
30828 pub climb: f32,
30829 #[doc = "Current heading in compass units (0-360, 0=north)."]
30830 pub heading: i16,
30831 #[doc = "Current throttle setting (0 to 100)."]
30832 pub throttle: u16,
30833}
30834impl VFR_HUD_DATA {
30835 pub const ENCODED_LEN: usize = 20usize;
30836 pub const DEFAULT: Self = Self {
30837 airspeed: 0.0_f32,
30838 groundspeed: 0.0_f32,
30839 alt: 0.0_f32,
30840 climb: 0.0_f32,
30841 heading: 0_i16,
30842 throttle: 0_u16,
30843 };
30844 #[cfg(feature = "arbitrary")]
30845 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
30846 use arbitrary::{Arbitrary, Unstructured};
30847 let mut buf = [0u8; 1024];
30848 rng.fill_bytes(&mut buf);
30849 let mut unstructured = Unstructured::new(&buf);
30850 Self::arbitrary(&mut unstructured).unwrap_or_default()
30851 }
30852}
30853impl Default for VFR_HUD_DATA {
30854 fn default() -> Self {
30855 Self::DEFAULT.clone()
30856 }
30857}
30858impl MessageData for VFR_HUD_DATA {
30859 type Message = MavMessage;
30860 const ID: u32 = 74u32;
30861 const NAME: &'static str = "VFR_HUD";
30862 const EXTRA_CRC: u8 = 20u8;
30863 const ENCODED_LEN: usize = 20usize;
30864 fn deser(
30865 _version: MavlinkVersion,
30866 __input: &[u8],
30867 ) -> Result<Self, ::mavlink_core::error::ParserError> {
30868 let avail_len = __input.len();
30869 let mut payload_buf = [0; Self::ENCODED_LEN];
30870 let mut buf = if avail_len < Self::ENCODED_LEN {
30871 payload_buf[0..avail_len].copy_from_slice(__input);
30872 Bytes::new(&payload_buf)
30873 } else {
30874 Bytes::new(__input)
30875 };
30876 let mut __struct = Self::default();
30877 __struct.airspeed = buf.get_f32_le();
30878 __struct.groundspeed = buf.get_f32_le();
30879 __struct.alt = buf.get_f32_le();
30880 __struct.climb = buf.get_f32_le();
30881 __struct.heading = buf.get_i16_le();
30882 __struct.throttle = buf.get_u16_le();
30883 Ok(__struct)
30884 }
30885 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
30886 let mut __tmp = BytesMut::new(bytes);
30887 #[allow(clippy::absurd_extreme_comparisons)]
30888 #[allow(unused_comparisons)]
30889 if __tmp.remaining() < Self::ENCODED_LEN {
30890 panic!(
30891 "buffer is too small (need {} bytes, but got {})",
30892 Self::ENCODED_LEN,
30893 __tmp.remaining(),
30894 )
30895 }
30896 __tmp.put_f32_le(self.airspeed);
30897 __tmp.put_f32_le(self.groundspeed);
30898 __tmp.put_f32_le(self.alt);
30899 __tmp.put_f32_le(self.climb);
30900 __tmp.put_i16_le(self.heading);
30901 __tmp.put_u16_le(self.throttle);
30902 if matches!(version, MavlinkVersion::V2) {
30903 let len = __tmp.len();
30904 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
30905 } else {
30906 __tmp.len()
30907 }
30908 }
30909}
30910#[doc = "Vibration levels and accelerometer clipping."]
30911#[doc = ""]
30912#[doc = "ID: 241"]
30913#[derive(Debug, Clone, PartialEq)]
30914#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
30915#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
30916#[cfg_attr(feature = "ts", derive(TS))]
30917#[cfg_attr(feature = "ts", ts(export))]
30918pub struct VIBRATION_DATA {
30919 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
30920 pub time_usec: u64,
30921 #[doc = "Vibration levels on X-axis"]
30922 pub vibration_x: f32,
30923 #[doc = "Vibration levels on Y-axis"]
30924 pub vibration_y: f32,
30925 #[doc = "Vibration levels on Z-axis"]
30926 pub vibration_z: f32,
30927 #[doc = "first accelerometer clipping count"]
30928 pub clipping_0: u32,
30929 #[doc = "second accelerometer clipping count"]
30930 pub clipping_1: u32,
30931 #[doc = "third accelerometer clipping count"]
30932 pub clipping_2: u32,
30933}
30934impl VIBRATION_DATA {
30935 pub const ENCODED_LEN: usize = 32usize;
30936 pub const DEFAULT: Self = Self {
30937 time_usec: 0_u64,
30938 vibration_x: 0.0_f32,
30939 vibration_y: 0.0_f32,
30940 vibration_z: 0.0_f32,
30941 clipping_0: 0_u32,
30942 clipping_1: 0_u32,
30943 clipping_2: 0_u32,
30944 };
30945 #[cfg(feature = "arbitrary")]
30946 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
30947 use arbitrary::{Arbitrary, Unstructured};
30948 let mut buf = [0u8; 1024];
30949 rng.fill_bytes(&mut buf);
30950 let mut unstructured = Unstructured::new(&buf);
30951 Self::arbitrary(&mut unstructured).unwrap_or_default()
30952 }
30953}
30954impl Default for VIBRATION_DATA {
30955 fn default() -> Self {
30956 Self::DEFAULT.clone()
30957 }
30958}
30959impl MessageData for VIBRATION_DATA {
30960 type Message = MavMessage;
30961 const ID: u32 = 241u32;
30962 const NAME: &'static str = "VIBRATION";
30963 const EXTRA_CRC: u8 = 90u8;
30964 const ENCODED_LEN: usize = 32usize;
30965 fn deser(
30966 _version: MavlinkVersion,
30967 __input: &[u8],
30968 ) -> Result<Self, ::mavlink_core::error::ParserError> {
30969 let avail_len = __input.len();
30970 let mut payload_buf = [0; Self::ENCODED_LEN];
30971 let mut buf = if avail_len < Self::ENCODED_LEN {
30972 payload_buf[0..avail_len].copy_from_slice(__input);
30973 Bytes::new(&payload_buf)
30974 } else {
30975 Bytes::new(__input)
30976 };
30977 let mut __struct = Self::default();
30978 __struct.time_usec = buf.get_u64_le();
30979 __struct.vibration_x = buf.get_f32_le();
30980 __struct.vibration_y = buf.get_f32_le();
30981 __struct.vibration_z = buf.get_f32_le();
30982 __struct.clipping_0 = buf.get_u32_le();
30983 __struct.clipping_1 = buf.get_u32_le();
30984 __struct.clipping_2 = buf.get_u32_le();
30985 Ok(__struct)
30986 }
30987 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
30988 let mut __tmp = BytesMut::new(bytes);
30989 #[allow(clippy::absurd_extreme_comparisons)]
30990 #[allow(unused_comparisons)]
30991 if __tmp.remaining() < Self::ENCODED_LEN {
30992 panic!(
30993 "buffer is too small (need {} bytes, but got {})",
30994 Self::ENCODED_LEN,
30995 __tmp.remaining(),
30996 )
30997 }
30998 __tmp.put_u64_le(self.time_usec);
30999 __tmp.put_f32_le(self.vibration_x);
31000 __tmp.put_f32_le(self.vibration_y);
31001 __tmp.put_f32_le(self.vibration_z);
31002 __tmp.put_u32_le(self.clipping_0);
31003 __tmp.put_u32_le(self.clipping_1);
31004 __tmp.put_u32_le(self.clipping_2);
31005 if matches!(version, MavlinkVersion::V2) {
31006 let len = __tmp.len();
31007 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
31008 } else {
31009 __tmp.len()
31010 }
31011 }
31012}
31013#[doc = "Global position estimate from a Vicon motion system source."]
31014#[doc = ""]
31015#[doc = "ID: 104"]
31016#[derive(Debug, Clone, PartialEq)]
31017#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
31018#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
31019#[cfg_attr(feature = "ts", derive(TS))]
31020#[cfg_attr(feature = "ts", ts(export))]
31021pub struct VICON_POSITION_ESTIMATE_DATA {
31022 #[doc = "Timestamp (UNIX time or time since system boot)"]
31023 pub usec: u64,
31024 #[doc = "Global X position"]
31025 pub x: f32,
31026 #[doc = "Global Y position"]
31027 pub y: f32,
31028 #[doc = "Global Z position"]
31029 pub z: f32,
31030 #[doc = "Roll angle"]
31031 pub roll: f32,
31032 #[doc = "Pitch angle"]
31033 pub pitch: f32,
31034 #[doc = "Yaw angle"]
31035 pub yaw: f32,
31036 #[doc = "Row-major representation of 6x6 pose cross-covariance matrix upper right triangle (states: x, y, z, roll, pitch, yaw; first six entries are the first ROW, next five entries are the second ROW, etc.). If unknown, assign NaN value to first element in the array."]
31037 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
31038 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
31039 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
31040 pub covariance: [f32; 21],
31041}
31042impl VICON_POSITION_ESTIMATE_DATA {
31043 pub const ENCODED_LEN: usize = 116usize;
31044 pub const DEFAULT: Self = Self {
31045 usec: 0_u64,
31046 x: 0.0_f32,
31047 y: 0.0_f32,
31048 z: 0.0_f32,
31049 roll: 0.0_f32,
31050 pitch: 0.0_f32,
31051 yaw: 0.0_f32,
31052 covariance: [0.0_f32; 21usize],
31053 };
31054 #[cfg(feature = "arbitrary")]
31055 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
31056 use arbitrary::{Arbitrary, Unstructured};
31057 let mut buf = [0u8; 1024];
31058 rng.fill_bytes(&mut buf);
31059 let mut unstructured = Unstructured::new(&buf);
31060 Self::arbitrary(&mut unstructured).unwrap_or_default()
31061 }
31062}
31063impl Default for VICON_POSITION_ESTIMATE_DATA {
31064 fn default() -> Self {
31065 Self::DEFAULT.clone()
31066 }
31067}
31068impl MessageData for VICON_POSITION_ESTIMATE_DATA {
31069 type Message = MavMessage;
31070 const ID: u32 = 104u32;
31071 const NAME: &'static str = "VICON_POSITION_ESTIMATE";
31072 const EXTRA_CRC: u8 = 56u8;
31073 const ENCODED_LEN: usize = 116usize;
31074 fn deser(
31075 _version: MavlinkVersion,
31076 __input: &[u8],
31077 ) -> Result<Self, ::mavlink_core::error::ParserError> {
31078 let avail_len = __input.len();
31079 let mut payload_buf = [0; Self::ENCODED_LEN];
31080 let mut buf = if avail_len < Self::ENCODED_LEN {
31081 payload_buf[0..avail_len].copy_from_slice(__input);
31082 Bytes::new(&payload_buf)
31083 } else {
31084 Bytes::new(__input)
31085 };
31086 let mut __struct = Self::default();
31087 __struct.usec = buf.get_u64_le();
31088 __struct.x = buf.get_f32_le();
31089 __struct.y = buf.get_f32_le();
31090 __struct.z = buf.get_f32_le();
31091 __struct.roll = buf.get_f32_le();
31092 __struct.pitch = buf.get_f32_le();
31093 __struct.yaw = buf.get_f32_le();
31094 for v in &mut __struct.covariance {
31095 let val = buf.get_f32_le();
31096 *v = val;
31097 }
31098 Ok(__struct)
31099 }
31100 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
31101 let mut __tmp = BytesMut::new(bytes);
31102 #[allow(clippy::absurd_extreme_comparisons)]
31103 #[allow(unused_comparisons)]
31104 if __tmp.remaining() < Self::ENCODED_LEN {
31105 panic!(
31106 "buffer is too small (need {} bytes, but got {})",
31107 Self::ENCODED_LEN,
31108 __tmp.remaining(),
31109 )
31110 }
31111 __tmp.put_u64_le(self.usec);
31112 __tmp.put_f32_le(self.x);
31113 __tmp.put_f32_le(self.y);
31114 __tmp.put_f32_le(self.z);
31115 __tmp.put_f32_le(self.roll);
31116 __tmp.put_f32_le(self.pitch);
31117 __tmp.put_f32_le(self.yaw);
31118 if matches!(version, MavlinkVersion::V2) {
31119 for val in &self.covariance {
31120 __tmp.put_f32_le(*val);
31121 }
31122 let len = __tmp.len();
31123 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
31124 } else {
31125 __tmp.len()
31126 }
31127 }
31128}
31129#[doc = "Information about video stream. It may be requested using MAV_CMD_REQUEST_MESSAGE, where param2 indicates the video stream id: 0 for all streams, 1 for first, 2 for second, etc."]
31130#[doc = ""]
31131#[doc = "ID: 269"]
31132#[derive(Debug, Clone, PartialEq)]
31133#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
31134#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
31135#[cfg_attr(feature = "ts", derive(TS))]
31136#[cfg_attr(feature = "ts", ts(export))]
31137pub struct VIDEO_STREAM_INFORMATION_DATA {
31138 #[doc = "Frame rate."]
31139 pub framerate: f32,
31140 #[doc = "Bit rate."]
31141 pub bitrate: u32,
31142 #[doc = "Bitmap of stream status flags."]
31143 pub flags: VideoStreamStatusFlags,
31144 #[doc = "Horizontal resolution."]
31145 pub resolution_h: u16,
31146 #[doc = "Vertical resolution."]
31147 pub resolution_v: u16,
31148 #[doc = "Video image rotation clockwise."]
31149 pub rotation: u16,
31150 #[doc = "Horizontal Field of view."]
31151 pub hfov: u16,
31152 #[doc = "Video Stream ID (1 for first, 2 for second, etc.)"]
31153 pub stream_id: u8,
31154 #[doc = "Number of streams available."]
31155 pub count: u8,
31156 #[doc = "Type of stream."]
31157 pub mavtype: VideoStreamType,
31158 #[doc = "Stream name."]
31159 #[cfg_attr(feature = "ts", ts(type = "string"))]
31160 pub name: CharArray<32>,
31161 #[doc = "Video stream URI (TCP or RTSP URI ground station should connect to) or port number (UDP port ground station should listen to)."]
31162 #[cfg_attr(feature = "ts", ts(type = "string"))]
31163 pub uri: CharArray<160>,
31164 #[doc = "Encoding of stream."]
31165 #[cfg_attr(feature = "serde", serde(default))]
31166 pub encoding: VideoStreamEncoding,
31167 #[doc = "Camera id of a non-MAVLink camera attached to an autopilot (1-6). 0 if the component is a MAVLink camera (with its own component id)."]
31168 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
31169 pub camera_device_id: u8,
31170}
31171impl VIDEO_STREAM_INFORMATION_DATA {
31172 pub const ENCODED_LEN: usize = 215usize;
31173 pub const DEFAULT: Self = Self {
31174 framerate: 0.0_f32,
31175 bitrate: 0_u32,
31176 flags: VideoStreamStatusFlags::DEFAULT,
31177 resolution_h: 0_u16,
31178 resolution_v: 0_u16,
31179 rotation: 0_u16,
31180 hfov: 0_u16,
31181 stream_id: 0_u8,
31182 count: 0_u8,
31183 mavtype: VideoStreamType::DEFAULT,
31184 name: CharArray::new([0_u8; 32usize]),
31185 uri: CharArray::new([0_u8; 160usize]),
31186 encoding: VideoStreamEncoding::DEFAULT,
31187 camera_device_id: 0_u8,
31188 };
31189 #[cfg(feature = "arbitrary")]
31190 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
31191 use arbitrary::{Arbitrary, Unstructured};
31192 let mut buf = [0u8; 1024];
31193 rng.fill_bytes(&mut buf);
31194 let mut unstructured = Unstructured::new(&buf);
31195 Self::arbitrary(&mut unstructured).unwrap_or_default()
31196 }
31197}
31198impl Default for VIDEO_STREAM_INFORMATION_DATA {
31199 fn default() -> Self {
31200 Self::DEFAULT.clone()
31201 }
31202}
31203impl MessageData for VIDEO_STREAM_INFORMATION_DATA {
31204 type Message = MavMessage;
31205 const ID: u32 = 269u32;
31206 const NAME: &'static str = "VIDEO_STREAM_INFORMATION";
31207 const EXTRA_CRC: u8 = 109u8;
31208 const ENCODED_LEN: usize = 215usize;
31209 fn deser(
31210 _version: MavlinkVersion,
31211 __input: &[u8],
31212 ) -> Result<Self, ::mavlink_core::error::ParserError> {
31213 let avail_len = __input.len();
31214 let mut payload_buf = [0; Self::ENCODED_LEN];
31215 let mut buf = if avail_len < Self::ENCODED_LEN {
31216 payload_buf[0..avail_len].copy_from_slice(__input);
31217 Bytes::new(&payload_buf)
31218 } else {
31219 Bytes::new(__input)
31220 };
31221 let mut __struct = Self::default();
31222 __struct.framerate = buf.get_f32_le();
31223 __struct.bitrate = buf.get_u32_le();
31224 let tmp = buf.get_u16_le();
31225 __struct.flags =
31226 VideoStreamStatusFlags::from_bits(tmp as <VideoStreamStatusFlags as Flags>::Bits)
31227 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
31228 flag_type: "VideoStreamStatusFlags",
31229 value: tmp as u64,
31230 })?;
31231 __struct.resolution_h = buf.get_u16_le();
31232 __struct.resolution_v = buf.get_u16_le();
31233 __struct.rotation = buf.get_u16_le();
31234 __struct.hfov = buf.get_u16_le();
31235 __struct.stream_id = buf.get_u8();
31236 __struct.count = buf.get_u8();
31237 let tmp = buf.get_u8();
31238 __struct.mavtype =
31239 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
31240 enum_type: "VideoStreamType",
31241 value: tmp as u64,
31242 })?;
31243 let mut tmp = [0_u8; 32usize];
31244 for v in &mut tmp {
31245 *v = buf.get_u8();
31246 }
31247 __struct.name = CharArray::new(tmp);
31248 let mut tmp = [0_u8; 160usize];
31249 for v in &mut tmp {
31250 *v = buf.get_u8();
31251 }
31252 __struct.uri = CharArray::new(tmp);
31253 let tmp = buf.get_u8();
31254 __struct.encoding =
31255 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
31256 enum_type: "VideoStreamEncoding",
31257 value: tmp as u64,
31258 })?;
31259 __struct.camera_device_id = buf.get_u8();
31260 Ok(__struct)
31261 }
31262 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
31263 let mut __tmp = BytesMut::new(bytes);
31264 #[allow(clippy::absurd_extreme_comparisons)]
31265 #[allow(unused_comparisons)]
31266 if __tmp.remaining() < Self::ENCODED_LEN {
31267 panic!(
31268 "buffer is too small (need {} bytes, but got {})",
31269 Self::ENCODED_LEN,
31270 __tmp.remaining(),
31271 )
31272 }
31273 __tmp.put_f32_le(self.framerate);
31274 __tmp.put_u32_le(self.bitrate);
31275 __tmp.put_u16_le(self.flags.bits() as u16);
31276 __tmp.put_u16_le(self.resolution_h);
31277 __tmp.put_u16_le(self.resolution_v);
31278 __tmp.put_u16_le(self.rotation);
31279 __tmp.put_u16_le(self.hfov);
31280 __tmp.put_u8(self.stream_id);
31281 __tmp.put_u8(self.count);
31282 __tmp.put_u8(self.mavtype as u8);
31283 for val in &self.name {
31284 __tmp.put_u8(*val);
31285 }
31286 for val in &self.uri {
31287 __tmp.put_u8(*val);
31288 }
31289 if matches!(version, MavlinkVersion::V2) {
31290 __tmp.put_u8(self.encoding as u8);
31291 __tmp.put_u8(self.camera_device_id);
31292 let len = __tmp.len();
31293 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
31294 } else {
31295 __tmp.len()
31296 }
31297 }
31298}
31299#[doc = "Information about the status of a video stream. It may be requested using MAV_CMD_REQUEST_MESSAGE."]
31300#[doc = ""]
31301#[doc = "ID: 270"]
31302#[derive(Debug, Clone, PartialEq)]
31303#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
31304#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
31305#[cfg_attr(feature = "ts", derive(TS))]
31306#[cfg_attr(feature = "ts", ts(export))]
31307pub struct VIDEO_STREAM_STATUS_DATA {
31308 #[doc = "Frame rate"]
31309 pub framerate: f32,
31310 #[doc = "Bit rate"]
31311 pub bitrate: u32,
31312 #[doc = "Bitmap of stream status flags"]
31313 pub flags: VideoStreamStatusFlags,
31314 #[doc = "Horizontal resolution"]
31315 pub resolution_h: u16,
31316 #[doc = "Vertical resolution"]
31317 pub resolution_v: u16,
31318 #[doc = "Video image rotation clockwise"]
31319 pub rotation: u16,
31320 #[doc = "Horizontal Field of view"]
31321 pub hfov: u16,
31322 #[doc = "Video Stream ID (1 for first, 2 for second, etc.)"]
31323 pub stream_id: u8,
31324 #[doc = "Camera id of a non-MAVLink camera attached to an autopilot (1-6). 0 if the component is a MAVLink camera (with its own component id)."]
31325 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
31326 pub camera_device_id: u8,
31327}
31328impl VIDEO_STREAM_STATUS_DATA {
31329 pub const ENCODED_LEN: usize = 20usize;
31330 pub const DEFAULT: Self = Self {
31331 framerate: 0.0_f32,
31332 bitrate: 0_u32,
31333 flags: VideoStreamStatusFlags::DEFAULT,
31334 resolution_h: 0_u16,
31335 resolution_v: 0_u16,
31336 rotation: 0_u16,
31337 hfov: 0_u16,
31338 stream_id: 0_u8,
31339 camera_device_id: 0_u8,
31340 };
31341 #[cfg(feature = "arbitrary")]
31342 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
31343 use arbitrary::{Arbitrary, Unstructured};
31344 let mut buf = [0u8; 1024];
31345 rng.fill_bytes(&mut buf);
31346 let mut unstructured = Unstructured::new(&buf);
31347 Self::arbitrary(&mut unstructured).unwrap_or_default()
31348 }
31349}
31350impl Default for VIDEO_STREAM_STATUS_DATA {
31351 fn default() -> Self {
31352 Self::DEFAULT.clone()
31353 }
31354}
31355impl MessageData for VIDEO_STREAM_STATUS_DATA {
31356 type Message = MavMessage;
31357 const ID: u32 = 270u32;
31358 const NAME: &'static str = "VIDEO_STREAM_STATUS";
31359 const EXTRA_CRC: u8 = 59u8;
31360 const ENCODED_LEN: usize = 20usize;
31361 fn deser(
31362 _version: MavlinkVersion,
31363 __input: &[u8],
31364 ) -> Result<Self, ::mavlink_core::error::ParserError> {
31365 let avail_len = __input.len();
31366 let mut payload_buf = [0; Self::ENCODED_LEN];
31367 let mut buf = if avail_len < Self::ENCODED_LEN {
31368 payload_buf[0..avail_len].copy_from_slice(__input);
31369 Bytes::new(&payload_buf)
31370 } else {
31371 Bytes::new(__input)
31372 };
31373 let mut __struct = Self::default();
31374 __struct.framerate = buf.get_f32_le();
31375 __struct.bitrate = buf.get_u32_le();
31376 let tmp = buf.get_u16_le();
31377 __struct.flags =
31378 VideoStreamStatusFlags::from_bits(tmp as <VideoStreamStatusFlags as Flags>::Bits)
31379 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
31380 flag_type: "VideoStreamStatusFlags",
31381 value: tmp as u64,
31382 })?;
31383 __struct.resolution_h = buf.get_u16_le();
31384 __struct.resolution_v = buf.get_u16_le();
31385 __struct.rotation = buf.get_u16_le();
31386 __struct.hfov = buf.get_u16_le();
31387 __struct.stream_id = buf.get_u8();
31388 __struct.camera_device_id = buf.get_u8();
31389 Ok(__struct)
31390 }
31391 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
31392 let mut __tmp = BytesMut::new(bytes);
31393 #[allow(clippy::absurd_extreme_comparisons)]
31394 #[allow(unused_comparisons)]
31395 if __tmp.remaining() < Self::ENCODED_LEN {
31396 panic!(
31397 "buffer is too small (need {} bytes, but got {})",
31398 Self::ENCODED_LEN,
31399 __tmp.remaining(),
31400 )
31401 }
31402 __tmp.put_f32_le(self.framerate);
31403 __tmp.put_u32_le(self.bitrate);
31404 __tmp.put_u16_le(self.flags.bits() as u16);
31405 __tmp.put_u16_le(self.resolution_h);
31406 __tmp.put_u16_le(self.resolution_v);
31407 __tmp.put_u16_le(self.rotation);
31408 __tmp.put_u16_le(self.hfov);
31409 __tmp.put_u8(self.stream_id);
31410 if matches!(version, MavlinkVersion::V2) {
31411 __tmp.put_u8(self.camera_device_id);
31412 let len = __tmp.len();
31413 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
31414 } else {
31415 __tmp.len()
31416 }
31417 }
31418}
31419#[doc = "Local position/attitude estimate from a vision source."]
31420#[doc = ""]
31421#[doc = "ID: 102"]
31422#[derive(Debug, Clone, PartialEq)]
31423#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
31424#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
31425#[cfg_attr(feature = "ts", derive(TS))]
31426#[cfg_attr(feature = "ts", ts(export))]
31427pub struct VISION_POSITION_ESTIMATE_DATA {
31428 #[doc = "Timestamp (UNIX time or time since system boot)"]
31429 pub usec: u64,
31430 #[doc = "Local X position"]
31431 pub x: f32,
31432 #[doc = "Local Y position"]
31433 pub y: f32,
31434 #[doc = "Local Z position"]
31435 pub z: f32,
31436 #[doc = "Roll angle"]
31437 pub roll: f32,
31438 #[doc = "Pitch angle"]
31439 pub pitch: f32,
31440 #[doc = "Yaw angle"]
31441 pub yaw: f32,
31442 #[doc = "Row-major representation of pose 6x6 cross-covariance matrix upper right triangle (states: x, y, z, roll, pitch, yaw; first six entries are the first ROW, next five entries are the second ROW, etc.). If unknown, assign NaN value to first element in the array."]
31443 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
31444 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
31445 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
31446 pub covariance: [f32; 21],
31447 #[doc = "Estimate reset counter. This should be incremented when the estimate resets in any of the dimensions (position, velocity, attitude, angular speed). This is designed to be used when e.g an external SLAM system detects a loop-closure and the estimate jumps."]
31448 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
31449 pub reset_counter: u8,
31450}
31451impl VISION_POSITION_ESTIMATE_DATA {
31452 pub const ENCODED_LEN: usize = 117usize;
31453 pub const DEFAULT: Self = Self {
31454 usec: 0_u64,
31455 x: 0.0_f32,
31456 y: 0.0_f32,
31457 z: 0.0_f32,
31458 roll: 0.0_f32,
31459 pitch: 0.0_f32,
31460 yaw: 0.0_f32,
31461 covariance: [0.0_f32; 21usize],
31462 reset_counter: 0_u8,
31463 };
31464 #[cfg(feature = "arbitrary")]
31465 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
31466 use arbitrary::{Arbitrary, Unstructured};
31467 let mut buf = [0u8; 1024];
31468 rng.fill_bytes(&mut buf);
31469 let mut unstructured = Unstructured::new(&buf);
31470 Self::arbitrary(&mut unstructured).unwrap_or_default()
31471 }
31472}
31473impl Default for VISION_POSITION_ESTIMATE_DATA {
31474 fn default() -> Self {
31475 Self::DEFAULT.clone()
31476 }
31477}
31478impl MessageData for VISION_POSITION_ESTIMATE_DATA {
31479 type Message = MavMessage;
31480 const ID: u32 = 102u32;
31481 const NAME: &'static str = "VISION_POSITION_ESTIMATE";
31482 const EXTRA_CRC: u8 = 158u8;
31483 const ENCODED_LEN: usize = 117usize;
31484 fn deser(
31485 _version: MavlinkVersion,
31486 __input: &[u8],
31487 ) -> Result<Self, ::mavlink_core::error::ParserError> {
31488 let avail_len = __input.len();
31489 let mut payload_buf = [0; Self::ENCODED_LEN];
31490 let mut buf = if avail_len < Self::ENCODED_LEN {
31491 payload_buf[0..avail_len].copy_from_slice(__input);
31492 Bytes::new(&payload_buf)
31493 } else {
31494 Bytes::new(__input)
31495 };
31496 let mut __struct = Self::default();
31497 __struct.usec = buf.get_u64_le();
31498 __struct.x = buf.get_f32_le();
31499 __struct.y = buf.get_f32_le();
31500 __struct.z = buf.get_f32_le();
31501 __struct.roll = buf.get_f32_le();
31502 __struct.pitch = buf.get_f32_le();
31503 __struct.yaw = buf.get_f32_le();
31504 for v in &mut __struct.covariance {
31505 let val = buf.get_f32_le();
31506 *v = val;
31507 }
31508 __struct.reset_counter = buf.get_u8();
31509 Ok(__struct)
31510 }
31511 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
31512 let mut __tmp = BytesMut::new(bytes);
31513 #[allow(clippy::absurd_extreme_comparisons)]
31514 #[allow(unused_comparisons)]
31515 if __tmp.remaining() < Self::ENCODED_LEN {
31516 panic!(
31517 "buffer is too small (need {} bytes, but got {})",
31518 Self::ENCODED_LEN,
31519 __tmp.remaining(),
31520 )
31521 }
31522 __tmp.put_u64_le(self.usec);
31523 __tmp.put_f32_le(self.x);
31524 __tmp.put_f32_le(self.y);
31525 __tmp.put_f32_le(self.z);
31526 __tmp.put_f32_le(self.roll);
31527 __tmp.put_f32_le(self.pitch);
31528 __tmp.put_f32_le(self.yaw);
31529 if matches!(version, MavlinkVersion::V2) {
31530 for val in &self.covariance {
31531 __tmp.put_f32_le(*val);
31532 }
31533 __tmp.put_u8(self.reset_counter);
31534 let len = __tmp.len();
31535 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
31536 } else {
31537 __tmp.len()
31538 }
31539 }
31540}
31541#[doc = "Speed estimate from a vision source."]
31542#[doc = ""]
31543#[doc = "ID: 103"]
31544#[derive(Debug, Clone, PartialEq)]
31545#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
31546#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
31547#[cfg_attr(feature = "ts", derive(TS))]
31548#[cfg_attr(feature = "ts", ts(export))]
31549pub struct VISION_SPEED_ESTIMATE_DATA {
31550 #[doc = "Timestamp (UNIX time or time since system boot)"]
31551 pub usec: u64,
31552 #[doc = "Global X speed"]
31553 pub x: f32,
31554 #[doc = "Global Y speed"]
31555 pub y: f32,
31556 #[doc = "Global Z speed"]
31557 pub z: f32,
31558 #[doc = "Row-major representation of 3x3 linear velocity covariance matrix (states: vx, vy, vz; 1st three entries - 1st row, etc.). If unknown, assign NaN value to first element in the array."]
31559 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
31560 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
31561 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
31562 pub covariance: [f32; 9],
31563 #[doc = "Estimate reset counter. This should be incremented when the estimate resets in any of the dimensions (position, velocity, attitude, angular speed). This is designed to be used when e.g an external SLAM system detects a loop-closure and the estimate jumps."]
31564 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
31565 pub reset_counter: u8,
31566}
31567impl VISION_SPEED_ESTIMATE_DATA {
31568 pub const ENCODED_LEN: usize = 57usize;
31569 pub const DEFAULT: Self = Self {
31570 usec: 0_u64,
31571 x: 0.0_f32,
31572 y: 0.0_f32,
31573 z: 0.0_f32,
31574 covariance: [0.0_f32; 9usize],
31575 reset_counter: 0_u8,
31576 };
31577 #[cfg(feature = "arbitrary")]
31578 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
31579 use arbitrary::{Arbitrary, Unstructured};
31580 let mut buf = [0u8; 1024];
31581 rng.fill_bytes(&mut buf);
31582 let mut unstructured = Unstructured::new(&buf);
31583 Self::arbitrary(&mut unstructured).unwrap_or_default()
31584 }
31585}
31586impl Default for VISION_SPEED_ESTIMATE_DATA {
31587 fn default() -> Self {
31588 Self::DEFAULT.clone()
31589 }
31590}
31591impl MessageData for VISION_SPEED_ESTIMATE_DATA {
31592 type Message = MavMessage;
31593 const ID: u32 = 103u32;
31594 const NAME: &'static str = "VISION_SPEED_ESTIMATE";
31595 const EXTRA_CRC: u8 = 208u8;
31596 const ENCODED_LEN: usize = 57usize;
31597 fn deser(
31598 _version: MavlinkVersion,
31599 __input: &[u8],
31600 ) -> Result<Self, ::mavlink_core::error::ParserError> {
31601 let avail_len = __input.len();
31602 let mut payload_buf = [0; Self::ENCODED_LEN];
31603 let mut buf = if avail_len < Self::ENCODED_LEN {
31604 payload_buf[0..avail_len].copy_from_slice(__input);
31605 Bytes::new(&payload_buf)
31606 } else {
31607 Bytes::new(__input)
31608 };
31609 let mut __struct = Self::default();
31610 __struct.usec = buf.get_u64_le();
31611 __struct.x = buf.get_f32_le();
31612 __struct.y = buf.get_f32_le();
31613 __struct.z = buf.get_f32_le();
31614 for v in &mut __struct.covariance {
31615 let val = buf.get_f32_le();
31616 *v = val;
31617 }
31618 __struct.reset_counter = buf.get_u8();
31619 Ok(__struct)
31620 }
31621 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
31622 let mut __tmp = BytesMut::new(bytes);
31623 #[allow(clippy::absurd_extreme_comparisons)]
31624 #[allow(unused_comparisons)]
31625 if __tmp.remaining() < Self::ENCODED_LEN {
31626 panic!(
31627 "buffer is too small (need {} bytes, but got {})",
31628 Self::ENCODED_LEN,
31629 __tmp.remaining(),
31630 )
31631 }
31632 __tmp.put_u64_le(self.usec);
31633 __tmp.put_f32_le(self.x);
31634 __tmp.put_f32_le(self.y);
31635 __tmp.put_f32_le(self.z);
31636 if matches!(version, MavlinkVersion::V2) {
31637 for val in &self.covariance {
31638 __tmp.put_f32_le(*val);
31639 }
31640 __tmp.put_u8(self.reset_counter);
31641 let len = __tmp.len();
31642 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
31643 } else {
31644 __tmp.len()
31645 }
31646 }
31647}
31648#[doc = "Cumulative distance traveled for each reported wheel."]
31649#[doc = ""]
31650#[doc = "ID: 9000"]
31651#[derive(Debug, Clone, PartialEq)]
31652#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
31653#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
31654#[cfg_attr(feature = "ts", derive(TS))]
31655#[cfg_attr(feature = "ts", ts(export))]
31656pub struct WHEEL_DISTANCE_DATA {
31657 #[doc = "Timestamp (synced to UNIX time or since system boot)."]
31658 pub time_usec: u64,
31659 #[doc = "Distance reported by individual wheel encoders. Forward rotations increase values, reverse rotations decrease them. Not all wheels will necessarily have wheel encoders; the mapping of encoders to wheel positions must be agreed/understood by the endpoints."]
31660 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
31661 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
31662 pub distance: [f64; 16],
31663 #[doc = "Number of wheels reported."]
31664 pub count: u8,
31665}
31666impl WHEEL_DISTANCE_DATA {
31667 pub const ENCODED_LEN: usize = 137usize;
31668 pub const DEFAULT: Self = Self {
31669 time_usec: 0_u64,
31670 distance: [0.0_f64; 16usize],
31671 count: 0_u8,
31672 };
31673 #[cfg(feature = "arbitrary")]
31674 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
31675 use arbitrary::{Arbitrary, Unstructured};
31676 let mut buf = [0u8; 1024];
31677 rng.fill_bytes(&mut buf);
31678 let mut unstructured = Unstructured::new(&buf);
31679 Self::arbitrary(&mut unstructured).unwrap_or_default()
31680 }
31681}
31682impl Default for WHEEL_DISTANCE_DATA {
31683 fn default() -> Self {
31684 Self::DEFAULT.clone()
31685 }
31686}
31687impl MessageData for WHEEL_DISTANCE_DATA {
31688 type Message = MavMessage;
31689 const ID: u32 = 9000u32;
31690 const NAME: &'static str = "WHEEL_DISTANCE";
31691 const EXTRA_CRC: u8 = 113u8;
31692 const ENCODED_LEN: usize = 137usize;
31693 fn deser(
31694 _version: MavlinkVersion,
31695 __input: &[u8],
31696 ) -> Result<Self, ::mavlink_core::error::ParserError> {
31697 let avail_len = __input.len();
31698 let mut payload_buf = [0; Self::ENCODED_LEN];
31699 let mut buf = if avail_len < Self::ENCODED_LEN {
31700 payload_buf[0..avail_len].copy_from_slice(__input);
31701 Bytes::new(&payload_buf)
31702 } else {
31703 Bytes::new(__input)
31704 };
31705 let mut __struct = Self::default();
31706 __struct.time_usec = buf.get_u64_le();
31707 for v in &mut __struct.distance {
31708 let val = buf.get_f64_le();
31709 *v = val;
31710 }
31711 __struct.count = buf.get_u8();
31712 Ok(__struct)
31713 }
31714 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
31715 let mut __tmp = BytesMut::new(bytes);
31716 #[allow(clippy::absurd_extreme_comparisons)]
31717 #[allow(unused_comparisons)]
31718 if __tmp.remaining() < Self::ENCODED_LEN {
31719 panic!(
31720 "buffer is too small (need {} bytes, but got {})",
31721 Self::ENCODED_LEN,
31722 __tmp.remaining(),
31723 )
31724 }
31725 __tmp.put_u64_le(self.time_usec);
31726 for val in &self.distance {
31727 __tmp.put_f64_le(*val);
31728 }
31729 __tmp.put_u8(self.count);
31730 if matches!(version, MavlinkVersion::V2) {
31731 let len = __tmp.len();
31732 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
31733 } else {
31734 __tmp.len()
31735 }
31736 }
31737}
31738#[doc = "Configure WiFi AP SSID, password, and mode. This message is re-emitted as an acknowledgement by the AP. The message may also be explicitly requested using MAV_CMD_REQUEST_MESSAGE."]
31739#[doc = ""]
31740#[doc = "ID: 299"]
31741#[derive(Debug, Clone, PartialEq)]
31742#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
31743#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
31744#[cfg_attr(feature = "ts", derive(TS))]
31745#[cfg_attr(feature = "ts", ts(export))]
31746pub struct WIFI_CONFIG_AP_DATA {
31747 #[doc = "Name of Wi-Fi network (SSID). Blank to leave it unchanged when setting. Current SSID when sent back as a response."]
31748 #[cfg_attr(feature = "ts", ts(type = "string"))]
31749 pub ssid: CharArray<32>,
31750 #[doc = "Password. Blank for an open AP. MD5 hash when message is sent back as a response."]
31751 #[cfg_attr(feature = "ts", ts(type = "string"))]
31752 pub password: CharArray<64>,
31753 #[doc = "WiFi Mode."]
31754 #[cfg_attr(feature = "serde", serde(default))]
31755 pub mode: WifiConfigApMode,
31756 #[doc = "Message acceptance response (sent back to GS)."]
31757 #[cfg_attr(feature = "serde", serde(default))]
31758 pub response: WifiConfigApResponse,
31759}
31760impl WIFI_CONFIG_AP_DATA {
31761 pub const ENCODED_LEN: usize = 98usize;
31762 pub const DEFAULT: Self = Self {
31763 ssid: CharArray::new([0_u8; 32usize]),
31764 password: CharArray::new([0_u8; 64usize]),
31765 mode: WifiConfigApMode::DEFAULT,
31766 response: WifiConfigApResponse::DEFAULT,
31767 };
31768 #[cfg(feature = "arbitrary")]
31769 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
31770 use arbitrary::{Arbitrary, Unstructured};
31771 let mut buf = [0u8; 1024];
31772 rng.fill_bytes(&mut buf);
31773 let mut unstructured = Unstructured::new(&buf);
31774 Self::arbitrary(&mut unstructured).unwrap_or_default()
31775 }
31776}
31777impl Default for WIFI_CONFIG_AP_DATA {
31778 fn default() -> Self {
31779 Self::DEFAULT.clone()
31780 }
31781}
31782impl MessageData for WIFI_CONFIG_AP_DATA {
31783 type Message = MavMessage;
31784 const ID: u32 = 299u32;
31785 const NAME: &'static str = "WIFI_CONFIG_AP";
31786 const EXTRA_CRC: u8 = 19u8;
31787 const ENCODED_LEN: usize = 98usize;
31788 fn deser(
31789 _version: MavlinkVersion,
31790 __input: &[u8],
31791 ) -> Result<Self, ::mavlink_core::error::ParserError> {
31792 let avail_len = __input.len();
31793 let mut payload_buf = [0; Self::ENCODED_LEN];
31794 let mut buf = if avail_len < Self::ENCODED_LEN {
31795 payload_buf[0..avail_len].copy_from_slice(__input);
31796 Bytes::new(&payload_buf)
31797 } else {
31798 Bytes::new(__input)
31799 };
31800 let mut __struct = Self::default();
31801 let mut tmp = [0_u8; 32usize];
31802 for v in &mut tmp {
31803 *v = buf.get_u8();
31804 }
31805 __struct.ssid = CharArray::new(tmp);
31806 let mut tmp = [0_u8; 64usize];
31807 for v in &mut tmp {
31808 *v = buf.get_u8();
31809 }
31810 __struct.password = CharArray::new(tmp);
31811 let tmp = buf.get_i8();
31812 __struct.mode =
31813 FromPrimitive::from_i8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
31814 enum_type: "WifiConfigApMode",
31815 value: tmp as u64,
31816 })?;
31817 let tmp = buf.get_i8();
31818 __struct.response =
31819 FromPrimitive::from_i8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
31820 enum_type: "WifiConfigApResponse",
31821 value: tmp as u64,
31822 })?;
31823 Ok(__struct)
31824 }
31825 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
31826 let mut __tmp = BytesMut::new(bytes);
31827 #[allow(clippy::absurd_extreme_comparisons)]
31828 #[allow(unused_comparisons)]
31829 if __tmp.remaining() < Self::ENCODED_LEN {
31830 panic!(
31831 "buffer is too small (need {} bytes, but got {})",
31832 Self::ENCODED_LEN,
31833 __tmp.remaining(),
31834 )
31835 }
31836 for val in &self.ssid {
31837 __tmp.put_u8(*val);
31838 }
31839 for val in &self.password {
31840 __tmp.put_u8(*val);
31841 }
31842 if matches!(version, MavlinkVersion::V2) {
31843 __tmp.put_i8(self.mode as i8);
31844 __tmp.put_i8(self.response as i8);
31845 let len = __tmp.len();
31846 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
31847 } else {
31848 __tmp.len()
31849 }
31850 }
31851}
31852#[doc = "Winch status."]
31853#[doc = ""]
31854#[doc = "ID: 9005"]
31855#[derive(Debug, Clone, PartialEq)]
31856#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
31857#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
31858#[cfg_attr(feature = "ts", derive(TS))]
31859#[cfg_attr(feature = "ts", ts(export))]
31860pub struct WINCH_STATUS_DATA {
31861 #[doc = "Timestamp (synced to UNIX time or since system boot)."]
31862 pub time_usec: u64,
31863 #[doc = "Length of line released. NaN if unknown"]
31864 pub line_length: f32,
31865 #[doc = "Speed line is being released or retracted. Positive values if being released, negative values if being retracted, NaN if unknown"]
31866 pub speed: f32,
31867 #[doc = "Tension on the line. NaN if unknown"]
31868 pub tension: f32,
31869 #[doc = "Voltage of the battery supplying the winch. NaN if unknown"]
31870 pub voltage: f32,
31871 #[doc = "Current draw from the winch. NaN if unknown"]
31872 pub current: f32,
31873 #[doc = "Status flags"]
31874 pub status: MavWinchStatusFlag,
31875 #[doc = "Temperature of the motor. INT16_MAX if unknown"]
31876 pub temperature: i16,
31877}
31878impl WINCH_STATUS_DATA {
31879 pub const ENCODED_LEN: usize = 34usize;
31880 pub const DEFAULT: Self = Self {
31881 time_usec: 0_u64,
31882 line_length: 0.0_f32,
31883 speed: 0.0_f32,
31884 tension: 0.0_f32,
31885 voltage: 0.0_f32,
31886 current: 0.0_f32,
31887 status: MavWinchStatusFlag::DEFAULT,
31888 temperature: 0_i16,
31889 };
31890 #[cfg(feature = "arbitrary")]
31891 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
31892 use arbitrary::{Arbitrary, Unstructured};
31893 let mut buf = [0u8; 1024];
31894 rng.fill_bytes(&mut buf);
31895 let mut unstructured = Unstructured::new(&buf);
31896 Self::arbitrary(&mut unstructured).unwrap_or_default()
31897 }
31898}
31899impl Default for WINCH_STATUS_DATA {
31900 fn default() -> Self {
31901 Self::DEFAULT.clone()
31902 }
31903}
31904impl MessageData for WINCH_STATUS_DATA {
31905 type Message = MavMessage;
31906 const ID: u32 = 9005u32;
31907 const NAME: &'static str = "WINCH_STATUS";
31908 const EXTRA_CRC: u8 = 117u8;
31909 const ENCODED_LEN: usize = 34usize;
31910 fn deser(
31911 _version: MavlinkVersion,
31912 __input: &[u8],
31913 ) -> Result<Self, ::mavlink_core::error::ParserError> {
31914 let avail_len = __input.len();
31915 let mut payload_buf = [0; Self::ENCODED_LEN];
31916 let mut buf = if avail_len < Self::ENCODED_LEN {
31917 payload_buf[0..avail_len].copy_from_slice(__input);
31918 Bytes::new(&payload_buf)
31919 } else {
31920 Bytes::new(__input)
31921 };
31922 let mut __struct = Self::default();
31923 __struct.time_usec = buf.get_u64_le();
31924 __struct.line_length = buf.get_f32_le();
31925 __struct.speed = buf.get_f32_le();
31926 __struct.tension = buf.get_f32_le();
31927 __struct.voltage = buf.get_f32_le();
31928 __struct.current = buf.get_f32_le();
31929 let tmp = buf.get_u32_le();
31930 __struct.status = MavWinchStatusFlag::from_bits(tmp as <MavWinchStatusFlag as Flags>::Bits)
31931 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
31932 flag_type: "MavWinchStatusFlag",
31933 value: tmp as u64,
31934 })?;
31935 __struct.temperature = buf.get_i16_le();
31936 Ok(__struct)
31937 }
31938 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
31939 let mut __tmp = BytesMut::new(bytes);
31940 #[allow(clippy::absurd_extreme_comparisons)]
31941 #[allow(unused_comparisons)]
31942 if __tmp.remaining() < Self::ENCODED_LEN {
31943 panic!(
31944 "buffer is too small (need {} bytes, but got {})",
31945 Self::ENCODED_LEN,
31946 __tmp.remaining(),
31947 )
31948 }
31949 __tmp.put_u64_le(self.time_usec);
31950 __tmp.put_f32_le(self.line_length);
31951 __tmp.put_f32_le(self.speed);
31952 __tmp.put_f32_le(self.tension);
31953 __tmp.put_f32_le(self.voltage);
31954 __tmp.put_f32_le(self.current);
31955 __tmp.put_u32_le(self.status.bits() as u32);
31956 __tmp.put_i16_le(self.temperature);
31957 if matches!(version, MavlinkVersion::V2) {
31958 let len = __tmp.len();
31959 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
31960 } else {
31961 __tmp.len()
31962 }
31963 }
31964}
31965#[doc = "Wind estimate from vehicle. Note that despite the name, this message does not actually contain any covariances but instead variability and accuracy fields in terms of standard deviation (1-STD)."]
31966#[doc = ""]
31967#[doc = "ID: 231"]
31968#[derive(Debug, Clone, PartialEq)]
31969#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
31970#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
31971#[cfg_attr(feature = "ts", derive(TS))]
31972#[cfg_attr(feature = "ts", ts(export))]
31973pub struct WIND_COV_DATA {
31974 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
31975 pub time_usec: u64,
31976 #[doc = "Wind in North (NED) direction (NAN if unknown)"]
31977 pub wind_x: f32,
31978 #[doc = "Wind in East (NED) direction (NAN if unknown)"]
31979 pub wind_y: f32,
31980 #[doc = "Wind in down (NED) direction (NAN if unknown)"]
31981 pub wind_z: f32,
31982 #[doc = "Variability of wind in XY, 1-STD estimated from a 1 Hz lowpassed wind estimate (NAN if unknown)"]
31983 pub var_horiz: f32,
31984 #[doc = "Variability of wind in Z, 1-STD estimated from a 1 Hz lowpassed wind estimate (NAN if unknown)"]
31985 pub var_vert: f32,
31986 #[doc = "Altitude (MSL) that this measurement was taken at (NAN if unknown)"]
31987 pub wind_alt: f32,
31988 #[doc = "Horizontal speed 1-STD accuracy (0 if unknown)"]
31989 pub horiz_accuracy: f32,
31990 #[doc = "Vertical speed 1-STD accuracy (0 if unknown)"]
31991 pub vert_accuracy: f32,
31992}
31993impl WIND_COV_DATA {
31994 pub const ENCODED_LEN: usize = 40usize;
31995 pub const DEFAULT: Self = Self {
31996 time_usec: 0_u64,
31997 wind_x: 0.0_f32,
31998 wind_y: 0.0_f32,
31999 wind_z: 0.0_f32,
32000 var_horiz: 0.0_f32,
32001 var_vert: 0.0_f32,
32002 wind_alt: 0.0_f32,
32003 horiz_accuracy: 0.0_f32,
32004 vert_accuracy: 0.0_f32,
32005 };
32006 #[cfg(feature = "arbitrary")]
32007 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
32008 use arbitrary::{Arbitrary, Unstructured};
32009 let mut buf = [0u8; 1024];
32010 rng.fill_bytes(&mut buf);
32011 let mut unstructured = Unstructured::new(&buf);
32012 Self::arbitrary(&mut unstructured).unwrap_or_default()
32013 }
32014}
32015impl Default for WIND_COV_DATA {
32016 fn default() -> Self {
32017 Self::DEFAULT.clone()
32018 }
32019}
32020impl MessageData for WIND_COV_DATA {
32021 type Message = MavMessage;
32022 const ID: u32 = 231u32;
32023 const NAME: &'static str = "WIND_COV";
32024 const EXTRA_CRC: u8 = 105u8;
32025 const ENCODED_LEN: usize = 40usize;
32026 fn deser(
32027 _version: MavlinkVersion,
32028 __input: &[u8],
32029 ) -> Result<Self, ::mavlink_core::error::ParserError> {
32030 let avail_len = __input.len();
32031 let mut payload_buf = [0; Self::ENCODED_LEN];
32032 let mut buf = if avail_len < Self::ENCODED_LEN {
32033 payload_buf[0..avail_len].copy_from_slice(__input);
32034 Bytes::new(&payload_buf)
32035 } else {
32036 Bytes::new(__input)
32037 };
32038 let mut __struct = Self::default();
32039 __struct.time_usec = buf.get_u64_le();
32040 __struct.wind_x = buf.get_f32_le();
32041 __struct.wind_y = buf.get_f32_le();
32042 __struct.wind_z = buf.get_f32_le();
32043 __struct.var_horiz = buf.get_f32_le();
32044 __struct.var_vert = buf.get_f32_le();
32045 __struct.wind_alt = buf.get_f32_le();
32046 __struct.horiz_accuracy = buf.get_f32_le();
32047 __struct.vert_accuracy = buf.get_f32_le();
32048 Ok(__struct)
32049 }
32050 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
32051 let mut __tmp = BytesMut::new(bytes);
32052 #[allow(clippy::absurd_extreme_comparisons)]
32053 #[allow(unused_comparisons)]
32054 if __tmp.remaining() < Self::ENCODED_LEN {
32055 panic!(
32056 "buffer is too small (need {} bytes, but got {})",
32057 Self::ENCODED_LEN,
32058 __tmp.remaining(),
32059 )
32060 }
32061 __tmp.put_u64_le(self.time_usec);
32062 __tmp.put_f32_le(self.wind_x);
32063 __tmp.put_f32_le(self.wind_y);
32064 __tmp.put_f32_le(self.wind_z);
32065 __tmp.put_f32_le(self.var_horiz);
32066 __tmp.put_f32_le(self.var_vert);
32067 __tmp.put_f32_le(self.wind_alt);
32068 __tmp.put_f32_le(self.horiz_accuracy);
32069 __tmp.put_f32_le(self.vert_accuracy);
32070 if matches!(version, MavlinkVersion::V2) {
32071 let len = __tmp.len();
32072 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
32073 } else {
32074 __tmp.len()
32075 }
32076 }
32077}
32078#[derive(Clone, PartialEq, Debug)]
32079#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
32080#[cfg_attr(feature = "serde", serde(tag = "type"))]
32081#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
32082#[cfg_attr(feature = "ts", derive(TS))]
32083#[cfg_attr(feature = "ts", ts(export))]
32084#[repr(u32)]
32085pub enum MavMessage {
32086 #[doc = "Set the vehicle attitude and body angular rates."]
32087 #[doc = ""]
32088 #[doc = "ID: 140"]
32089 ACTUATOR_CONTROL_TARGET(ACTUATOR_CONTROL_TARGET_DATA),
32090 #[doc = "The raw values of the actuator outputs (e.g. on Pixhawk, from MAIN, AUX ports). This message supersedes SERVO_OUTPUT_RAW."]
32091 #[doc = ""]
32092 #[doc = "ID: 375"]
32093 ACTUATOR_OUTPUT_STATUS(ACTUATOR_OUTPUT_STATUS_DATA),
32094 #[doc = "The location and information of an ADSB vehicle."]
32095 #[doc = ""]
32096 #[doc = "ID: 246"]
32097 ADSB_VEHICLE(ADSB_VEHICLE_DATA),
32098 #[doc = "The location and information of an AIS vessel."]
32099 #[doc = ""]
32100 #[doc = "ID: 301"]
32101 AIS_VESSEL(AIS_VESSEL_DATA),
32102 #[doc = "The current system altitude."]
32103 #[doc = ""]
32104 #[doc = "ID: 141"]
32105 ALTITUDE(ALTITUDE_DATA),
32106 #[doc = "The attitude in the aeronautical frame (right-handed, Z-down, Y-right, X-front, ZYX, intrinsic)."]
32107 #[doc = ""]
32108 #[doc = "ID: 30"]
32109 ATTITUDE(ATTITUDE_DATA),
32110 #[doc = "The attitude in the aeronautical frame (right-handed, Z-down, X-front, Y-right), expressed as quaternion. Quaternion order is w, x, y, z and a zero rotation would be expressed as (1 0 0 0)."]
32111 #[doc = ""]
32112 #[doc = "ID: 31"]
32113 ATTITUDE_QUATERNION(ATTITUDE_QUATERNION_DATA),
32114 #[doc = "The attitude in the aeronautical frame (right-handed, Z-down, X-front, Y-right), expressed as quaternion. Quaternion order is w, x, y, z and a zero rotation would be expressed as (1 0 0 0)."]
32115 #[doc = ""]
32116 #[doc = "ID: 61"]
32117 ATTITUDE_QUATERNION_COV(ATTITUDE_QUATERNION_COV_DATA),
32118 #[doc = "Reports the current commanded attitude of the vehicle as specified by the autopilot. This should match the commands sent in a SET_ATTITUDE_TARGET message if the vehicle is being controlled this way."]
32119 #[doc = ""]
32120 #[doc = "ID: 83"]
32121 ATTITUDE_TARGET(ATTITUDE_TARGET_DATA),
32122 #[doc = "Motion capture attitude and position."]
32123 #[doc = ""]
32124 #[doc = "ID: 138"]
32125 ATT_POS_MOCAP(ATT_POS_MOCAP_DATA),
32126 #[doc = "Emit an encrypted signature / key identifying this system. PLEASE NOTE: This protocol has been kept simple, so transmitting the key requires an encrypted channel for true safety."]
32127 #[doc = ""]
32128 #[doc = "ID: 7"]
32129 AUTH_KEY(AUTH_KEY_DATA),
32130 #[doc = "Low level message containing autopilot state relevant for a gimbal device. This message is to be sent from the autopilot to the gimbal device component. The data of this message are for the gimbal device's estimator corrections, in particular horizon compensation, as well as indicates autopilot control intentions, e.g. feed forward angular control in the z-axis."]
32131 #[doc = ""]
32132 #[doc = "ID: 286"]
32133 AUTOPILOT_STATE_FOR_GIMBAL_DEVICE(AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA),
32134 #[doc = "Version and capability of autopilot software. This should be emitted in response to a request with MAV_CMD_REQUEST_MESSAGE."]
32135 #[doc = ""]
32136 #[doc = "ID: 148"]
32137 AUTOPILOT_VERSION(AUTOPILOT_VERSION_DATA),
32138 #[doc = "Information about a flight mode. The message can be enumerated to get information for all modes, or requested for a particular mode, using MAV_CMD_REQUEST_MESSAGE. Specify 0 in param2 to request that the message is emitted for all available modes or the specific index for just one mode. The modes must be available/settable for the current vehicle/frame type. Each mode should only be emitted once (even if it is both standard and custom). Note that the current mode should be emitted in CURRENT_MODE, and that if the mode list can change then AVAILABLE_MODES_MONITOR must be emitted on first change and subsequently streamed. See <https://mavlink.io/en/services/standard_modes.html>."]
32139 #[doc = ""]
32140 #[doc = "ID: 435"]
32141 AVAILABLE_MODES(AVAILABLE_MODES_DATA),
32142 #[doc = "A change to the sequence number indicates that the set of AVAILABLE_MODES has changed. A receiver must re-request all available modes whenever the sequence number changes. This is only emitted after the first change and should then be broadcast at low rate (nominally 0.3 Hz) and on change. See <https://mavlink.io/en/services/standard_modes.html>."]
32143 #[doc = ""]
32144 #[doc = "ID: 437"]
32145 AVAILABLE_MODES_MONITOR(AVAILABLE_MODES_MONITOR_DATA),
32146 #[doc = "Battery information that is static, or requires infrequent update. This message should requested using MAV_CMD_REQUEST_MESSAGE and/or streamed at very low rate. BATTERY_STATUS_V2 is used for higher-rate battery status information."]
32147 #[doc = ""]
32148 #[doc = "ID: 372"]
32149 BATTERY_INFO(BATTERY_INFO_DATA),
32150 #[doc = "Battery information. Updates GCS with flight controller battery status. Smart batteries also use this message, but may additionally send BATTERY_INFO."]
32151 #[doc = ""]
32152 #[doc = "ID: 147"]
32153 BATTERY_STATUS(BATTERY_STATUS_DATA),
32154 #[doc = "Report button state change."]
32155 #[doc = ""]
32156 #[doc = "ID: 257"]
32157 BUTTON_CHANGE(BUTTON_CHANGE_DATA),
32158 #[doc = "Information about the status of a capture. Can be requested with a MAV_CMD_REQUEST_MESSAGE command."]
32159 #[doc = ""]
32160 #[doc = "ID: 262"]
32161 CAMERA_CAPTURE_STATUS(CAMERA_CAPTURE_STATUS_DATA),
32162 #[doc = "Information about the field of view of a camera. Can be requested with a MAV_CMD_REQUEST_MESSAGE command."]
32163 #[doc = ""]
32164 #[doc = "ID: 271"]
32165 CAMERA_FOV_STATUS(CAMERA_FOV_STATUS_DATA),
32166 #[doc = "Information about a captured image. This is emitted every time a message is captured. MAV_CMD_REQUEST_MESSAGE can be used to (re)request this message for a specific sequence number or range of sequence numbers: MAV_CMD_REQUEST_MESSAGE.param2 indicates the sequence number the first image to send, or set to -1 to send the message for all sequence numbers. MAV_CMD_REQUEST_MESSAGE.param3 is used to specify a range of messages to send: set to 0 (default) to send just the the message for the sequence number in param 2, set to -1 to send the message for the sequence number in param 2 and all the following sequence numbers, set to the sequence number of the final message in the range."]
32167 #[doc = ""]
32168 #[doc = "ID: 263"]
32169 CAMERA_IMAGE_CAPTURED(CAMERA_IMAGE_CAPTURED_DATA),
32170 #[doc = "Information about a camera. Can be requested with a MAV_CMD_REQUEST_MESSAGE command."]
32171 #[doc = ""]
32172 #[doc = "ID: 259"]
32173 CAMERA_INFORMATION(CAMERA_INFORMATION_DATA),
32174 #[doc = "Settings of a camera. Can be requested with a MAV_CMD_REQUEST_MESSAGE command."]
32175 #[doc = ""]
32176 #[doc = "ID: 260"]
32177 CAMERA_SETTINGS(CAMERA_SETTINGS_DATA),
32178 #[doc = "Camera absolute thermal range. This can be streamed when the associated VIDEO_STREAM_STATUS `flag` field bit VIDEO_STREAM_STATUS_FLAGS_THERMAL_RANGE_ENABLED is set, but a GCS may choose to only request it for the current active stream. Use MAV_CMD_SET_MESSAGE_INTERVAL to define message interval (param3 indicates the stream id of the current camera, or 0 for all streams, param4 indicates the target camera_device_id for autopilot-attached cameras or 0 for MAVLink cameras)."]
32179 #[doc = ""]
32180 #[doc = "ID: 277"]
32181 CAMERA_THERMAL_RANGE(CAMERA_THERMAL_RANGE_DATA),
32182 #[doc = "Camera tracking status, sent while in active tracking. Use MAV_CMD_SET_MESSAGE_INTERVAL to define message interval."]
32183 #[doc = ""]
32184 #[doc = "ID: 276"]
32185 CAMERA_TRACKING_GEO_STATUS(CAMERA_TRACKING_GEO_STATUS_DATA),
32186 #[doc = "Camera tracking status, sent while in active tracking. Use MAV_CMD_SET_MESSAGE_INTERVAL to define message interval."]
32187 #[doc = ""]
32188 #[doc = "ID: 275"]
32189 CAMERA_TRACKING_IMAGE_STATUS(CAMERA_TRACKING_IMAGE_STATUS_DATA),
32190 #[doc = "Camera-IMU triggering and synchronisation message."]
32191 #[doc = ""]
32192 #[doc = "ID: 112"]
32193 CAMERA_TRIGGER(CAMERA_TRIGGER_DATA),
32194 #[doc = "A forwarded CANFD frame as requested by MAV_CMD_CAN_FORWARD. These are separated from CAN_FRAME as they need different handling (eg. TAO handling)."]
32195 #[doc = ""]
32196 #[doc = "ID: 387"]
32197 CANFD_FRAME(CANFD_FRAME_DATA),
32198 #[doc = "Modify the filter of what CAN messages to forward over the mavlink. This can be used to make CAN forwarding work well on low bandwidth links. The filtering is applied on bits 8 to 24 of the CAN id (2nd and 3rd bytes) which corresponds to the DroneCAN message ID for DroneCAN. Filters with more than 16 IDs can be constructed by sending multiple CAN_FILTER_MODIFY messages."]
32199 #[doc = ""]
32200 #[doc = "ID: 388"]
32201 CAN_FILTER_MODIFY(CAN_FILTER_MODIFY_DATA),
32202 #[doc = "A forwarded CAN frame as requested by MAV_CMD_CAN_FORWARD."]
32203 #[doc = ""]
32204 #[doc = "ID: 386"]
32205 CAN_FRAME(CAN_FRAME_DATA),
32206 #[doc = "Configure cellular modems. This message is re-emitted as an acknowledgement by the modem. The message may also be explicitly requested using MAV_CMD_REQUEST_MESSAGE."]
32207 #[doc = ""]
32208 #[doc = "ID: 336"]
32209 CELLULAR_CONFIG(CELLULAR_CONFIG_DATA),
32210 #[doc = "Report current used cellular network status."]
32211 #[doc = ""]
32212 #[doc = "ID: 334"]
32213 CELLULAR_STATUS(CELLULAR_STATUS_DATA),
32214 #[doc = "Request to control this MAV."]
32215 #[doc = ""]
32216 #[doc = "ID: 5"]
32217 CHANGE_OPERATOR_CONTROL(CHANGE_OPERATOR_CONTROL_DATA),
32218 #[doc = "Accept / deny control of this MAV."]
32219 #[doc = ""]
32220 #[doc = "ID: 6"]
32221 CHANGE_OPERATOR_CONTROL_ACK(CHANGE_OPERATOR_CONTROL_ACK_DATA),
32222 #[doc = "Information about a potential collision."]
32223 #[doc = ""]
32224 #[doc = "ID: 247"]
32225 COLLISION(COLLISION_DATA),
32226 #[doc = "Report status of a command. Includes feedback whether the command was executed. The command microservice is documented at <https://mavlink.io/en/services/command.html>."]
32227 #[doc = ""]
32228 #[doc = "ID: 77"]
32229 COMMAND_ACK(COMMAND_ACK_DATA),
32230 #[doc = "Cancel a long running command. The target system should respond with a COMMAND_ACK to the original command with result=MAV_RESULT_CANCELLED if the long running process was cancelled. If it has already completed, the cancel action can be ignored. The cancel action can be retried until some sort of acknowledgement to the original command has been received. The command microservice is documented at <https://mavlink.io/en/services/command.html>."]
32231 #[doc = ""]
32232 #[doc = "ID: 80"]
32233 COMMAND_CANCEL(COMMAND_CANCEL_DATA),
32234 #[doc = "Send a command with up to seven parameters to the MAV, where params 5 and 6 are integers and the other values are floats. This is preferred over COMMAND_LONG as it allows the MAV_FRAME to be specified for interpreting positional information, such as altitude. COMMAND_INT is also preferred when sending latitude and longitude data in params 5 and 6, as it allows for greater precision. Param 5 and 6 encode positional data as scaled integers, where the scaling depends on the actual command value. NaN or INT32_MAX may be used in float/integer params (respectively) to indicate optional/default values (e.g. to use the component's current latitude, yaw rather than a specific value). The command microservice is documented at <https://mavlink.io/en/services/command.html>."]
32235 #[doc = ""]
32236 #[doc = "ID: 75"]
32237 COMMAND_INT(COMMAND_INT_DATA),
32238 #[doc = "Send a command with up to seven parameters to the MAV. COMMAND_INT is generally preferred when sending MAV_CMD commands that include positional information; it offers higher precision and allows the MAV_FRAME to be specified (which may otherwise be ambiguous, particularly for altitude). The command microservice is documented at <https://mavlink.io/en/services/command.html>."]
32239 #[doc = ""]
32240 #[doc = "ID: 76"]
32241 COMMAND_LONG(COMMAND_LONG_DATA),
32242 #[doc = "Component information message, which may be requested using MAV_CMD_REQUEST_MESSAGE."]
32243 #[doc = ""]
32244 #[doc = "ID: 395"]
32245 #[deprecated = " See `COMPONENT_METADATA` (Deprecated since 2022-04)"]
32246 COMPONENT_INFORMATION(COMPONENT_INFORMATION_DATA),
32247 #[doc = "Basic component information data. Should be requested using MAV_CMD_REQUEST_MESSAGE on startup, or when required."]
32248 #[doc = ""]
32249 #[doc = "ID: 396"]
32250 COMPONENT_INFORMATION_BASIC(COMPONENT_INFORMATION_BASIC_DATA),
32251 #[doc = "Component metadata message, which may be requested using MAV_CMD_REQUEST_MESSAGE. This contains the MAVLink FTP URI and CRC for the component's general metadata file. The file must be hosted on the component, and may be xz compressed. The file CRC can be used for file caching. The general metadata file can be read to get the locations of other metadata files (COMP_METADATA_TYPE) and translations, which may be hosted either on the vehicle or the internet. For more information see: <https://mavlink.io/en/services/component_information.html>. Note: Camera components should use CAMERA_INFORMATION instead, and autopilots may use both this message and AUTOPILOT_VERSION."]
32252 #[doc = ""]
32253 #[doc = "ID: 397"]
32254 COMPONENT_METADATA(COMPONENT_METADATA_DATA),
32255 #[doc = "The smoothed, monotonic system state used to feed the control loops of the system."]
32256 #[doc = ""]
32257 #[doc = "ID: 146"]
32258 CONTROL_SYSTEM_STATE(CONTROL_SYSTEM_STATE_DATA),
32259 #[doc = "Regular broadcast for the current latest event sequence number for a component. This is used to check for dropped events."]
32260 #[doc = ""]
32261 #[doc = "ID: 411"]
32262 CURRENT_EVENT_SEQUENCE(CURRENT_EVENT_SEQUENCE_DATA),
32263 #[doc = "Get the current mode. This should be emitted on any mode change, and broadcast at low rate (nominally 0.5 Hz). It may be requested using MAV_CMD_REQUEST_MESSAGE. See <https://mavlink.io/en/services/standard_modes.html>."]
32264 #[doc = ""]
32265 #[doc = "ID: 436"]
32266 CURRENT_MODE(CURRENT_MODE_DATA),
32267 #[doc = "Data stream status information."]
32268 #[doc = ""]
32269 #[doc = "ID: 67"]
32270 #[deprecated = " See `MESSAGE_INTERVAL` (Deprecated since 2015-08)"]
32271 DATA_STREAM(DATA_STREAM_DATA),
32272 #[doc = "Handshake message to initiate, control and stop image streaming when using the Image Transmission Protocol: <https://mavlink.io/en/services/image_transmission.html>."]
32273 #[doc = ""]
32274 #[doc = "ID: 130"]
32275 DATA_TRANSMISSION_HANDSHAKE(DATA_TRANSMISSION_HANDSHAKE_DATA),
32276 #[doc = "Send a debug value. The index is used to discriminate between values. These values show up in the plot of QGroundControl as DEBUG N."]
32277 #[doc = ""]
32278 #[doc = "ID: 254"]
32279 DEBUG(DEBUG_DATA),
32280 #[doc = "Large debug/prototyping array. The message uses the maximum available payload for data. The array_id and name fields are used to discriminate between messages in code and in user interfaces (respectively). Do not use in production code."]
32281 #[doc = ""]
32282 #[doc = "ID: 350"]
32283 DEBUG_FLOAT_ARRAY(DEBUG_FLOAT_ARRAY_DATA),
32284 #[doc = "To debug something using a named 3D vector."]
32285 #[doc = ""]
32286 #[doc = "ID: 250"]
32287 DEBUG_VECT(DEBUG_VECT_DATA),
32288 #[doc = "Distance sensor information for an onboard rangefinder."]
32289 #[doc = ""]
32290 #[doc = "ID: 132"]
32291 DISTANCE_SENSOR(DISTANCE_SENSOR_DATA),
32292 #[doc = "EFI status output."]
32293 #[doc = ""]
32294 #[doc = "ID: 225"]
32295 EFI_STATUS(EFI_STATUS_DATA),
32296 #[doc = "Data packet for images sent using the Image Transmission Protocol: <https://mavlink.io/en/services/image_transmission.html>."]
32297 #[doc = ""]
32298 #[doc = "ID: 131"]
32299 ENCAPSULATED_DATA(ENCAPSULATED_DATA_DATA),
32300 #[doc = "ESC information for lower rate streaming. Recommended streaming rate 1Hz. See ESC_STATUS for higher-rate ESC data."]
32301 #[doc = ""]
32302 #[doc = "ID: 290"]
32303 ESC_INFO(ESC_INFO_DATA),
32304 #[doc = "ESC information for higher rate streaming. Recommended streaming rate is ~10 Hz. Information that changes more slowly is sent in ESC_INFO. It should typically only be streamed on high-bandwidth links (i.e. to a companion computer)."]
32305 #[doc = ""]
32306 #[doc = "ID: 291"]
32307 ESC_STATUS(ESC_STATUS_DATA),
32308 #[doc = "Estimator status message including flags, innovation test ratios and estimated accuracies. The flags message is an integer bitmask containing information on which EKF outputs are valid. See the ESTIMATOR_STATUS_FLAGS enum definition for further information. The innovation test ratios show the magnitude of the sensor innovation divided by the innovation check threshold. Under normal operation the innovation test ratios should be below 0.5 with occasional values up to 1.0. Values greater than 1.0 should be rare under normal operation and indicate that a measurement has been rejected by the filter. The user should be notified if an innovation test ratio greater than 1.0 is recorded. Notifications for values in the range between 0.5 and 1.0 should be optional and controllable by the user."]
32309 #[doc = ""]
32310 #[doc = "ID: 230"]
32311 ESTIMATOR_STATUS(ESTIMATOR_STATUS_DATA),
32312 #[doc = "Event message. Each new event from a particular component gets a new sequence number. The same message might be sent multiple times if (re-)requested. Most events are broadcast, some can be specific to a target component (as receivers keep track of the sequence for missed events, all events need to be broadcast. Thus we use destination_component instead of target_component)."]
32313 #[doc = ""]
32314 #[doc = "ID: 410"]
32315 EVENT(EVENT_DATA),
32316 #[doc = "Provides state for additional features."]
32317 #[doc = ""]
32318 #[doc = "ID: 245"]
32319 EXTENDED_SYS_STATE(EXTENDED_SYS_STATE_DATA),
32320 #[doc = "Status of geo-fencing. Sent in extended status stream when fencing enabled."]
32321 #[doc = ""]
32322 #[doc = "ID: 162"]
32323 FENCE_STATUS(FENCE_STATUS_DATA),
32324 #[doc = "File transfer protocol message: <https://mavlink.io/en/services/ftp.html>."]
32325 #[doc = ""]
32326 #[doc = "ID: 110"]
32327 FILE_TRANSFER_PROTOCOL(FILE_TRANSFER_PROTOCOL_DATA),
32328 #[doc = "Flight information. This includes time since boot for arm, takeoff, and land, and a flight number. Takeoff and landing values reset to zero on arm. This can be requested using MAV_CMD_REQUEST_MESSAGE. Note, some fields are misnamed - timestamps are from boot (not UTC) and the flight_uuid is a sequence number."]
32329 #[doc = ""]
32330 #[doc = "ID: 264"]
32331 FLIGHT_INFORMATION(FLIGHT_INFORMATION_DATA),
32332 #[doc = "Current motion information from a designated system."]
32333 #[doc = ""]
32334 #[doc = "ID: 144"]
32335 FOLLOW_TARGET(FOLLOW_TARGET_DATA),
32336 #[doc = "Fuel status. This message provides \"generic\" fuel level information for in a GCS and for triggering failsafes in an autopilot. The fuel type and associated units for fields in this message are defined in the enum MAV_FUEL_TYPE. The reported `consumed_fuel` and `remaining_fuel` must only be supplied if measured: they must not be inferred from the `maximum_fuel` and the other value. A recipient can assume that if these fields are supplied they are accurate. If not provided, the recipient can infer `remaining_fuel` from `maximum_fuel` and `consumed_fuel` on the assumption that the fuel was initially at its maximum (this is what battery monitors assume). Note however that this is an assumption, and the UI should prompt the user appropriately (i.e. notify user that they should fill the tank before boot). This kind of information may also be sent in fuel-specific messages such as BATTERY_STATUS_V2. If both messages are sent for the same fuel system, the ids and corresponding information must match. This should be streamed (nominally at 0.1 Hz)."]
32337 #[doc = ""]
32338 #[doc = "ID: 371"]
32339 FUEL_STATUS(FUEL_STATUS_DATA),
32340 #[doc = "Telemetry of power generation system. Alternator or mechanical generator."]
32341 #[doc = ""]
32342 #[doc = "ID: 373"]
32343 GENERATOR_STATUS(GENERATOR_STATUS_DATA),
32344 #[doc = "Message reporting the status of a gimbal device. \t This message should be broadcast by a gimbal device component at a low regular rate (e.g. 5 Hz). \t For the angles encoded in the quaternion and the angular velocities holds: \t If the flag GIMBAL_DEVICE_FLAGS_YAW_IN_VEHICLE_FRAME is set, then they are relative to the vehicle heading (vehicle frame). \t If the flag GIMBAL_DEVICE_FLAGS_YAW_IN_EARTH_FRAME is set, then they are relative to absolute North (earth frame). \t If neither of these flags are set, then (for backwards compatibility) it holds: \t If the flag GIMBAL_DEVICE_FLAGS_YAW_LOCK is set, then they are relative to absolute North (earth frame), \t else they are relative to the vehicle heading (vehicle frame). \t Other conditions of the flags are not allowed. \t The quaternion and angular velocities in the other frame can be calculated from delta_yaw and delta_yaw_velocity as \t q_earth = q_delta_yaw * q_vehicle and w_earth = w_delta_yaw_velocity + w_vehicle (if not NaN). \t If neither the GIMBAL_DEVICE_FLAGS_YAW_IN_VEHICLE_FRAME nor the GIMBAL_DEVICE_FLAGS_YAW_IN_EARTH_FRAME flag is set, \t then (for backwards compatibility) the data in the delta_yaw and delta_yaw_velocity fields are to be ignored. \t New implementations should always set either GIMBAL_DEVICE_FLAGS_YAW_IN_VEHICLE_FRAME or GIMBAL_DEVICE_FLAGS_YAW_IN_EARTH_FRAME, \t and always should set delta_yaw and delta_yaw_velocity either to the proper value or NaN."]
32345 #[doc = ""]
32346 #[doc = "ID: 285"]
32347 GIMBAL_DEVICE_ATTITUDE_STATUS(GIMBAL_DEVICE_ATTITUDE_STATUS_DATA),
32348 #[doc = "Information about a low level gimbal. This message should be requested by the gimbal manager or a ground station using MAV_CMD_REQUEST_MESSAGE. The maximum angles and rates are the limits by hardware. However, the limits by software used are likely different/smaller and dependent on mode/settings/etc.."]
32349 #[doc = ""]
32350 #[doc = "ID: 283"]
32351 GIMBAL_DEVICE_INFORMATION(GIMBAL_DEVICE_INFORMATION_DATA),
32352 #[doc = "Low level message to control a gimbal device's attitude. \t This message is to be sent from the gimbal manager to the gimbal device component. \t The quaternion and angular velocities can be set to NaN according to use case. \t For the angles encoded in the quaternion and the angular velocities holds: \t If the flag GIMBAL_DEVICE_FLAGS_YAW_IN_VEHICLE_FRAME is set, then they are relative to the vehicle heading (vehicle frame). \t If the flag GIMBAL_DEVICE_FLAGS_YAW_IN_EARTH_FRAME is set, then they are relative to absolute North (earth frame). \t If neither of these flags are set, then (for backwards compatibility) it holds: \t If the flag GIMBAL_DEVICE_FLAGS_YAW_LOCK is set, then they are relative to absolute North (earth frame), \t else they are relative to the vehicle heading (vehicle frame). \t Setting both GIMBAL_DEVICE_FLAGS_YAW_IN_VEHICLE_FRAME and GIMBAL_DEVICE_FLAGS_YAW_IN_EARTH_FRAME is not allowed. \t These rules are to ensure backwards compatibility. \t New implementations should always set either GIMBAL_DEVICE_FLAGS_YAW_IN_VEHICLE_FRAME or GIMBAL_DEVICE_FLAGS_YAW_IN_EARTH_FRAME."]
32353 #[doc = ""]
32354 #[doc = "ID: 284"]
32355 GIMBAL_DEVICE_SET_ATTITUDE(GIMBAL_DEVICE_SET_ATTITUDE_DATA),
32356 #[doc = "Information about a high level gimbal manager. This message should be requested by a ground station using MAV_CMD_REQUEST_MESSAGE."]
32357 #[doc = ""]
32358 #[doc = "ID: 280"]
32359 GIMBAL_MANAGER_INFORMATION(GIMBAL_MANAGER_INFORMATION_DATA),
32360 #[doc = "High level message to control a gimbal's attitude. This message is to be sent to the gimbal manager (e.g. from a ground station). Angles and rates can be set to NaN according to use case."]
32361 #[doc = ""]
32362 #[doc = "ID: 282"]
32363 GIMBAL_MANAGER_SET_ATTITUDE(GIMBAL_MANAGER_SET_ATTITUDE_DATA),
32364 #[doc = "High level message to control a gimbal manually. The angles or angular rates are unitless; the actual rates will depend on internal gimbal manager settings/configuration (e.g. set by parameters). This message is to be sent to the gimbal manager (e.g. from a ground station). Angles and rates can be set to NaN according to use case."]
32365 #[doc = ""]
32366 #[doc = "ID: 288"]
32367 GIMBAL_MANAGER_SET_MANUAL_CONTROL(GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA),
32368 #[doc = "Set gimbal manager pitch and yaw angles (high rate message). This message is to be sent to the gimbal manager (e.g. from a ground station) and will be ignored by gimbal devices. Angles and rates can be set to NaN according to use case. Use MAV_CMD_DO_GIMBAL_MANAGER_PITCHYAW for low-rate adjustments that require confirmation."]
32369 #[doc = ""]
32370 #[doc = "ID: 287"]
32371 GIMBAL_MANAGER_SET_PITCHYAW(GIMBAL_MANAGER_SET_PITCHYAW_DATA),
32372 #[doc = "Current status about a high level gimbal manager. This message should be broadcast at a low regular rate (e.g. 5Hz)."]
32373 #[doc = ""]
32374 #[doc = "ID: 281"]
32375 GIMBAL_MANAGER_STATUS(GIMBAL_MANAGER_STATUS_DATA),
32376 #[doc = "The filtered global position (e.g. fused GPS and accelerometers). The position is in GPS-frame (right-handed, Z-up). It is designed as scaled integer message since the resolution of float is not sufficient."]
32377 #[doc = ""]
32378 #[doc = "ID: 33"]
32379 GLOBAL_POSITION_INT(GLOBAL_POSITION_INT_DATA),
32380 #[doc = "The filtered global position (e.g. fused GPS and accelerometers). The position is in GPS-frame (right-handed, Z-up). It is designed as scaled integer message since the resolution of float is not sufficient. NOTE: This message is intended for onboard networks / companion computers and higher-bandwidth links and optimized for accuracy and completeness. Please use the GLOBAL_POSITION_INT message for a minimal subset."]
32381 #[doc = ""]
32382 #[doc = "ID: 63"]
32383 GLOBAL_POSITION_INT_COV(GLOBAL_POSITION_INT_COV_DATA),
32384 #[doc = "Global position/attitude estimate from a vision source."]
32385 #[doc = ""]
32386 #[doc = "ID: 101"]
32387 GLOBAL_VISION_POSITION_ESTIMATE(GLOBAL_VISION_POSITION_ESTIMATE_DATA),
32388 #[doc = "Second GPS data."]
32389 #[doc = ""]
32390 #[doc = "ID: 124"]
32391 GPS2_RAW(GPS2_RAW_DATA),
32392 #[doc = "RTK GPS data. Gives information on the relative baseline calculation the GPS is reporting."]
32393 #[doc = ""]
32394 #[doc = "ID: 128"]
32395 GPS2_RTK(GPS2_RTK_DATA),
32396 #[doc = "Publishes the GPS coordinates of the vehicle local origin (0,0,0) position. Emitted whenever a new GPS-Local position mapping is requested or set - e.g. following SET_GPS_GLOBAL_ORIGIN message."]
32397 #[doc = ""]
32398 #[doc = "ID: 49"]
32399 GPS_GLOBAL_ORIGIN(GPS_GLOBAL_ORIGIN_DATA),
32400 #[doc = "Data for injecting into the onboard GPS (used for DGPS)."]
32401 #[doc = ""]
32402 #[doc = "ID: 123"]
32403 #[deprecated = " See `GPS_RTCM_DATA` (Deprecated since 2022-05)"]
32404 GPS_INJECT_DATA(GPS_INJECT_DATA_DATA),
32405 #[doc = "GPS sensor input message. This is a raw sensor value sent by the GPS. This is NOT the global position estimate of the system."]
32406 #[doc = ""]
32407 #[doc = "ID: 232"]
32408 GPS_INPUT(GPS_INPUT_DATA),
32409 #[doc = "The global position, as returned by the Global Positioning System (GPS). This is NOT the global position estimate of the system, but rather a RAW sensor value. See message GLOBAL_POSITION_INT for the global position estimate."]
32410 #[doc = ""]
32411 #[doc = "ID: 24"]
32412 GPS_RAW_INT(GPS_RAW_INT_DATA),
32413 #[doc = "RTCM message for injecting into the onboard GPS (used for DGPS)."]
32414 #[doc = ""]
32415 #[doc = "ID: 233"]
32416 GPS_RTCM_DATA(GPS_RTCM_DATA_DATA),
32417 #[doc = "RTK GPS data. Gives information on the relative baseline calculation the GPS is reporting."]
32418 #[doc = ""]
32419 #[doc = "ID: 127"]
32420 GPS_RTK(GPS_RTK_DATA),
32421 #[doc = "The positioning status, as reported by GPS. This message is intended to display status information about each satellite visible to the receiver. See message GLOBAL_POSITION_INT for the global position estimate. This message can contain information for up to 20 satellites."]
32422 #[doc = ""]
32423 #[doc = "ID: 25"]
32424 GPS_STATUS(GPS_STATUS_DATA),
32425 #[doc = "The heartbeat message shows that a system or component is present and responding. The type and autopilot fields (along with the message component id), allow the receiving system to treat further messages from this system appropriately (e.g. by laying out the user interface based on the autopilot). This microservice is documented at <https://mavlink.io/en/services/heartbeat.html>."]
32426 #[doc = ""]
32427 #[doc = "ID: 0"]
32428 HEARTBEAT(HEARTBEAT_DATA),
32429 #[doc = "The IMU readings in SI units in NED body frame."]
32430 #[doc = ""]
32431 #[doc = "ID: 105"]
32432 HIGHRES_IMU(HIGHRES_IMU_DATA),
32433 #[doc = "Message appropriate for high latency connections like Iridium."]
32434 #[doc = ""]
32435 #[doc = "ID: 234"]
32436 #[deprecated = " See `HIGH_LATENCY2` (Deprecated since 2020-10)"]
32437 HIGH_LATENCY(HIGH_LATENCY_DATA),
32438 #[doc = "Message appropriate for high latency connections like Iridium (version 2)."]
32439 #[doc = ""]
32440 #[doc = "ID: 235"]
32441 HIGH_LATENCY2(HIGH_LATENCY2_DATA),
32442 #[doc = "Sent from autopilot to simulation. Hardware in the loop control outputs. Alternative to HIL_CONTROLS."]
32443 #[doc = ""]
32444 #[doc = "ID: 93"]
32445 HIL_ACTUATOR_CONTROLS(HIL_ACTUATOR_CONTROLS_DATA),
32446 #[doc = "Sent from autopilot to simulation. Hardware in the loop control outputs. Alternative to HIL_ACTUATOR_CONTROLS."]
32447 #[doc = ""]
32448 #[doc = "ID: 91"]
32449 HIL_CONTROLS(HIL_CONTROLS_DATA),
32450 #[doc = "The global position, as returned by the Global Positioning System (GPS). This is NOT the global position estimate of the system, but rather a RAW sensor value. See message GLOBAL_POSITION_INT for the global position estimate."]
32451 #[doc = ""]
32452 #[doc = "ID: 113"]
32453 HIL_GPS(HIL_GPS_DATA),
32454 #[doc = "Simulated optical flow from a flow sensor (e.g. PX4FLOW or optical mouse sensor)."]
32455 #[doc = ""]
32456 #[doc = "ID: 114"]
32457 HIL_OPTICAL_FLOW(HIL_OPTICAL_FLOW_DATA),
32458 #[doc = "Sent from simulation to autopilot. The RAW values of the RC channels received. The standard PPM modulation is as follows: 1000 microseconds: 0%, 2000 microseconds: 100%. Individual receivers/transmitters might violate this specification."]
32459 #[doc = ""]
32460 #[doc = "ID: 92"]
32461 HIL_RC_INPUTS_RAW(HIL_RC_INPUTS_RAW_DATA),
32462 #[doc = "The IMU readings in SI units in NED body frame."]
32463 #[doc = ""]
32464 #[doc = "ID: 107"]
32465 HIL_SENSOR(HIL_SENSOR_DATA),
32466 #[doc = "Sent from simulation to autopilot. This packet is useful for high throughput applications such as hardware in the loop simulations."]
32467 #[doc = ""]
32468 #[doc = "ID: 90"]
32469 #[deprecated = "Suffers from missing airspeed fields and singularities due to Euler angles. See `HIL_STATE_QUATERNION` (Deprecated since 2013-07)"]
32470 HIL_STATE(HIL_STATE_DATA),
32471 #[doc = "Sent from simulation to autopilot, avoids in contrast to HIL_STATE singularities. This packet is useful for high throughput applications such as hardware in the loop simulations."]
32472 #[doc = ""]
32473 #[doc = "ID: 115"]
32474 HIL_STATE_QUATERNION(HIL_STATE_QUATERNION_DATA),
32475 #[doc = "Contains the home position. \tThe home position is the default position that the system will return to and land on. \tThe position must be set automatically by the system during the takeoff, and may also be explicitly set using MAV_CMD_DO_SET_HOME. \tThe global and local positions encode the position in the respective coordinate frames, while the q parameter encodes the orientation of the surface. \tUnder normal conditions it describes the heading and terrain slope, which can be used by the aircraft to adjust the approach. \tThe approach 3D vector describes the point to which the system should fly in normal flight mode and then perform a landing sequence along the vector. Note: this message can be requested by sending the MAV_CMD_REQUEST_MESSAGE with param1=242 (or the deprecated MAV_CMD_GET_HOME_POSITION command)."]
32476 #[doc = ""]
32477 #[doc = "ID: 242"]
32478 HOME_POSITION(HOME_POSITION_DATA),
32479 #[doc = "Temperature and humidity from hygrometer."]
32480 #[doc = ""]
32481 #[doc = "ID: 12920"]
32482 HYGROMETER_SENSOR(HYGROMETER_SENSOR_DATA),
32483 #[doc = "Illuminator status."]
32484 #[doc = ""]
32485 #[doc = "ID: 440"]
32486 ILLUMINATOR_STATUS(ILLUMINATOR_STATUS_DATA),
32487 #[doc = "Status of the Iridium SBD link."]
32488 #[doc = ""]
32489 #[doc = "ID: 335"]
32490 ISBD_LINK_STATUS(ISBD_LINK_STATUS_DATA),
32491 #[doc = "The location of a landing target. See: <https://mavlink.io/en/services/landing_target.html>."]
32492 #[doc = ""]
32493 #[doc = "ID: 149"]
32494 LANDING_TARGET(LANDING_TARGET_DATA),
32495 #[doc = "Status generated in each node in the communication chain and injected into MAVLink stream."]
32496 #[doc = ""]
32497 #[doc = "ID: 8"]
32498 LINK_NODE_STATUS(LINK_NODE_STATUS_DATA),
32499 #[doc = "The filtered local position (e.g. fused computer vision and accelerometers). Coordinate frame is right-handed, Z-axis down (aeronautical frame, NED / north-east-down convention)."]
32500 #[doc = ""]
32501 #[doc = "ID: 32"]
32502 LOCAL_POSITION_NED(LOCAL_POSITION_NED_DATA),
32503 #[doc = "The filtered local position (e.g. fused computer vision and accelerometers). Coordinate frame is right-handed, Z-axis down (aeronautical frame, NED / north-east-down convention)."]
32504 #[doc = ""]
32505 #[doc = "ID: 64"]
32506 LOCAL_POSITION_NED_COV(LOCAL_POSITION_NED_COV_DATA),
32507 #[doc = "The offset in X, Y, Z and yaw between the LOCAL_POSITION_NED messages of MAV X and the global coordinate frame in NED coordinates. Coordinate frame is right-handed, Z-axis down (aeronautical frame, NED / north-east-down convention)."]
32508 #[doc = ""]
32509 #[doc = "ID: 89"]
32510 LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET(LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA),
32511 #[doc = "An ack for a LOGGING_DATA_ACKED message."]
32512 #[doc = ""]
32513 #[doc = "ID: 268"]
32514 LOGGING_ACK(LOGGING_ACK_DATA),
32515 #[doc = "A message containing logged data (see also MAV_CMD_LOGGING_START)."]
32516 #[doc = ""]
32517 #[doc = "ID: 266"]
32518 LOGGING_DATA(LOGGING_DATA_DATA),
32519 #[doc = "A message containing logged data which requires a LOGGING_ACK to be sent back."]
32520 #[doc = ""]
32521 #[doc = "ID: 267"]
32522 LOGGING_DATA_ACKED(LOGGING_DATA_ACKED_DATA),
32523 #[doc = "Reply to LOG_REQUEST_DATA."]
32524 #[doc = ""]
32525 #[doc = "ID: 120"]
32526 LOG_DATA(LOG_DATA_DATA),
32527 #[doc = "Reply to LOG_REQUEST_LIST."]
32528 #[doc = ""]
32529 #[doc = "ID: 118"]
32530 LOG_ENTRY(LOG_ENTRY_DATA),
32531 #[doc = "Erase all logs."]
32532 #[doc = ""]
32533 #[doc = "ID: 121"]
32534 LOG_ERASE(LOG_ERASE_DATA),
32535 #[doc = "Request a chunk of a log."]
32536 #[doc = ""]
32537 #[doc = "ID: 119"]
32538 LOG_REQUEST_DATA(LOG_REQUEST_DATA_DATA),
32539 #[doc = "Stop log transfer and resume normal logging."]
32540 #[doc = ""]
32541 #[doc = "ID: 122"]
32542 LOG_REQUEST_END(LOG_REQUEST_END_DATA),
32543 #[doc = "Request a list of available logs. On some systems calling this may stop on-board logging until LOG_REQUEST_END is called. If there are no log files available this request shall be answered with one LOG_ENTRY message with id = 0 and num_logs = 0."]
32544 #[doc = ""]
32545 #[doc = "ID: 117"]
32546 LOG_REQUEST_LIST(LOG_REQUEST_LIST_DATA),
32547 #[doc = "Reports results of completed compass calibration. Sent until MAG_CAL_ACK received."]
32548 #[doc = ""]
32549 #[doc = "ID: 192"]
32550 MAG_CAL_REPORT(MAG_CAL_REPORT_DATA),
32551 #[doc = "This message provides an API for manually controlling the vehicle using standard joystick axes nomenclature, along with a joystick-like input device. Unused axes can be disabled and buttons states are transmitted as individual on/off bits of a bitmask."]
32552 #[doc = ""]
32553 #[doc = "ID: 69"]
32554 MANUAL_CONTROL(MANUAL_CONTROL_DATA),
32555 #[doc = "Setpoint in roll, pitch, yaw and thrust from the operator."]
32556 #[doc = ""]
32557 #[doc = "ID: 81"]
32558 MANUAL_SETPOINT(MANUAL_SETPOINT_DATA),
32559 #[doc = "Send raw controller memory. The use of this message is discouraged for normal packets, but a quite efficient way for testing new messages and getting experimental debug output."]
32560 #[doc = ""]
32561 #[doc = "ID: 249"]
32562 MEMORY_VECT(MEMORY_VECT_DATA),
32563 #[doc = "The interval between messages for a particular MAVLink message ID. This message is sent in response to the MAV_CMD_REQUEST_MESSAGE command with param1=244 (this message) and param2=message_id (the id of the message for which the interval is required). \tIt may also be sent in response to MAV_CMD_GET_MESSAGE_INTERVAL. \tThis interface replaces DATA_STREAM."]
32564 #[doc = ""]
32565 #[doc = "ID: 244"]
32566 MESSAGE_INTERVAL(MESSAGE_INTERVAL_DATA),
32567 #[doc = "Acknowledgment message during waypoint handling. The type field states if this message is a positive ack (type=0) or if an error happened (type=non-zero)."]
32568 #[doc = ""]
32569 #[doc = "ID: 47"]
32570 MISSION_ACK(MISSION_ACK_DATA),
32571 #[doc = "Delete all mission items at once."]
32572 #[doc = ""]
32573 #[doc = "ID: 45"]
32574 MISSION_CLEAR_ALL(MISSION_CLEAR_ALL_DATA),
32575 #[doc = "This message is emitted as response to MISSION_REQUEST_LIST by the MAV and to initiate a write transaction. The GCS can then request the individual mission item based on the knowledge of the total number of waypoints."]
32576 #[doc = ""]
32577 #[doc = "ID: 44"]
32578 MISSION_COUNT(MISSION_COUNT_DATA),
32579 #[doc = "Message that announces the sequence number of the current target mission item (that the system will fly towards/execute when the mission is running). This message should be streamed all the time (nominally at 1Hz). This message should be emitted following a call to MAV_CMD_DO_SET_MISSION_CURRENT or MISSION_SET_CURRENT."]
32580 #[doc = ""]
32581 #[doc = "ID: 42"]
32582 MISSION_CURRENT(MISSION_CURRENT_DATA),
32583 #[doc = "Message encoding a mission item. This message is emitted to announce the presence of a mission item and to set a mission item on the system. The mission item can be either in x, y, z meters (type: LOCAL) or x:lat, y:lon, z:altitude. Local frame is Z-down, right handed (NED), global frame is Z-up, right handed (ENU). NaN may be used to indicate an optional/default value (e.g. to use the system's current latitude or yaw rather than a specific value). See also <https://mavlink.io/en/services/mission.html>."]
32584 #[doc = ""]
32585 #[doc = "ID: 39"]
32586 #[deprecated = " See `MISSION_ITEM_INT` (Deprecated since 2020-06)"]
32587 MISSION_ITEM(MISSION_ITEM_DATA),
32588 #[doc = "Message encoding a mission item. This message is emitted to announce the presence of a mission item and to set a mission item on the system. The mission item can be either in x, y, z meters (type: LOCAL) or x:lat, y:lon, z:altitude. Local frame is Z-down, right handed (NED), global frame is Z-up, right handed (ENU). NaN or INT32_MAX may be used in float/integer params (respectively) to indicate optional/default values (e.g. to use the component's current latitude, yaw rather than a specific value). See also <https://mavlink.io/en/services/mission.html>."]
32589 #[doc = ""]
32590 #[doc = "ID: 73"]
32591 MISSION_ITEM_INT(MISSION_ITEM_INT_DATA),
32592 #[doc = "A certain mission item has been reached. The system will either hold this position (or circle on the orbit) or (if the autocontinue on the WP was set) continue to the next waypoint."]
32593 #[doc = ""]
32594 #[doc = "ID: 46"]
32595 MISSION_ITEM_REACHED(MISSION_ITEM_REACHED_DATA),
32596 #[doc = "Request the information of the mission item with the sequence number seq. The response of the system to this message should be a MISSION_ITEM message. <https://mavlink.io/en/services/mission.html>."]
32597 #[doc = ""]
32598 #[doc = "ID: 40"]
32599 #[deprecated = "A system that gets this request should respond with MISSION_ITEM_INT (as though MISSION_REQUEST_INT was received). See `MISSION_REQUEST_INT` (Deprecated since 2020-06)"]
32600 MISSION_REQUEST(MISSION_REQUEST_DATA),
32601 #[doc = "Request the information of the mission item with the sequence number seq. The response of the system to this message should be a MISSION_ITEM_INT message. <https://mavlink.io/en/services/mission.html>."]
32602 #[doc = ""]
32603 #[doc = "ID: 51"]
32604 MISSION_REQUEST_INT(MISSION_REQUEST_INT_DATA),
32605 #[doc = "Request the overall list of mission items from the system/component."]
32606 #[doc = ""]
32607 #[doc = "ID: 43"]
32608 MISSION_REQUEST_LIST(MISSION_REQUEST_LIST_DATA),
32609 #[doc = "Request a partial list of mission items from the system/component. <https://mavlink.io/en/services/mission.html>. If start and end index are the same, just send one waypoint."]
32610 #[doc = ""]
32611 #[doc = "ID: 37"]
32612 MISSION_REQUEST_PARTIAL_LIST(MISSION_REQUEST_PARTIAL_LIST_DATA),
32613 #[doc = "Set the mission item with sequence number seq as the current item and emit MISSION_CURRENT (whether or not the mission number changed). If a mission is currently being executed, the system will continue to this new mission item on the shortest path, skipping any intermediate mission items. Note that mission jump repeat counters are not reset (see MAV_CMD_DO_JUMP param2). This message may trigger a mission state-machine change on some systems: for example from MISSION_STATE_NOT_STARTED or MISSION_STATE_PAUSED to MISSION_STATE_ACTIVE. If the system is in mission mode, on those systems this command might therefore start, restart or resume the mission. If the system is not in mission mode this message must not trigger a switch to mission mode."]
32614 #[doc = ""]
32615 #[doc = "ID: 41"]
32616 #[deprecated = " See `MAV_CMD_DO_SET_MISSION_CURRENT` (Deprecated since 2022-08)"]
32617 MISSION_SET_CURRENT(MISSION_SET_CURRENT_DATA),
32618 #[doc = "This message is sent to the MAV to write a partial list. If start index == end index, only one item will be transmitted / updated. If the start index is NOT 0 and above the current list size, this request should be REJECTED!."]
32619 #[doc = ""]
32620 #[doc = "ID: 38"]
32621 MISSION_WRITE_PARTIAL_LIST(MISSION_WRITE_PARTIAL_LIST_DATA),
32622 #[doc = "Orientation of a mount."]
32623 #[doc = ""]
32624 #[doc = "ID: 265"]
32625 #[deprecated = "This message is being superseded by MAV_CMD_DO_GIMBAL_MANAGER_PITCHYAW. The message can still be used to communicate with legacy gimbals implementing it. See `MAV_CMD_DO_GIMBAL_MANAGER_PITCHYAW` (Deprecated since 2020-01)"]
32626 MOUNT_ORIENTATION(MOUNT_ORIENTATION_DATA),
32627 #[doc = "Send a key-value pair as float. The use of this message is discouraged for normal packets, but a quite efficient way for testing new messages and getting experimental debug output."]
32628 #[doc = ""]
32629 #[doc = "ID: 251"]
32630 NAMED_VALUE_FLOAT(NAMED_VALUE_FLOAT_DATA),
32631 #[doc = "Send a key-value pair as integer. The use of this message is discouraged for normal packets, but a quite efficient way for testing new messages and getting experimental debug output."]
32632 #[doc = ""]
32633 #[doc = "ID: 252"]
32634 NAMED_VALUE_INT(NAMED_VALUE_INT_DATA),
32635 #[doc = "The state of the navigation and position controller."]
32636 #[doc = ""]
32637 #[doc = "ID: 62"]
32638 NAV_CONTROLLER_OUTPUT(NAV_CONTROLLER_OUTPUT_DATA),
32639 #[doc = "Obstacle distances in front of the sensor, starting from the left in increment degrees to the right."]
32640 #[doc = ""]
32641 #[doc = "ID: 330"]
32642 OBSTACLE_DISTANCE(OBSTACLE_DISTANCE_DATA),
32643 #[doc = "Odometry message to communicate odometry information with an external interface. Fits ROS REP 147 standard for aerial vehicles (<http://www.ros.org/reps/rep-0147.html>)."]
32644 #[doc = ""]
32645 #[doc = "ID: 331"]
32646 ODOMETRY(ODOMETRY_DATA),
32647 #[doc = "Hardware status sent by an onboard computer."]
32648 #[doc = ""]
32649 #[doc = "ID: 390"]
32650 ONBOARD_COMPUTER_STATUS(ONBOARD_COMPUTER_STATUS_DATA),
32651 #[doc = "Transmitter (remote ID system) is enabled and ready to start sending location and other required information. This is streamed by transmitter. A flight controller uses it as a condition to arm."]
32652 #[doc = ""]
32653 #[doc = "ID: 12918"]
32654 OPEN_DRONE_ID_ARM_STATUS(OPEN_DRONE_ID_ARM_STATUS_DATA),
32655 #[doc = "Data for filling the OpenDroneID Authentication message. The Authentication Message defines a field that can provide a means of authenticity for the identity of the UAS (Unmanned Aircraft System). The Authentication message can have two different formats. For data page 0, the fields PageCount, Length and TimeStamp are present and AuthData is only 17 bytes. For data page 1 through 15, PageCount, Length and TimeStamp are not present and the size of AuthData is 23 bytes."]
32656 #[doc = ""]
32657 #[doc = "ID: 12902"]
32658 OPEN_DRONE_ID_AUTHENTICATION(OPEN_DRONE_ID_AUTHENTICATION_DATA),
32659 #[doc = "Data for filling the OpenDroneID Basic ID message. This and the below messages are primarily meant for feeding data to/from an OpenDroneID implementation. E.g. <https://github.com/opendroneid/opendroneid-core-c>. These messages are compatible with the ASTM F3411 Remote ID standard and the ASD-STAN prEN 4709-002 Direct Remote ID standard. Additional information and usage of these messages is documented at <https://mavlink.io/en/services/opendroneid.html>."]
32660 #[doc = ""]
32661 #[doc = "ID: 12900"]
32662 OPEN_DRONE_ID_BASIC_ID(OPEN_DRONE_ID_BASIC_ID_DATA),
32663 #[doc = "Data for filling the OpenDroneID Location message. The float data types are 32-bit IEEE 754. The Location message provides the location, altitude, direction and speed of the aircraft."]
32664 #[doc = ""]
32665 #[doc = "ID: 12901"]
32666 OPEN_DRONE_ID_LOCATION(OPEN_DRONE_ID_LOCATION_DATA),
32667 #[doc = "An OpenDroneID message pack is a container for multiple encoded OpenDroneID messages (i.e. not in the format given for the above message descriptions but after encoding into the compressed OpenDroneID byte format). Used e.g. when transmitting on Bluetooth 5.0 Long Range/Extended Advertising or on WiFi Neighbor Aware Networking or on WiFi Beacon."]
32668 #[doc = ""]
32669 #[doc = "ID: 12915"]
32670 OPEN_DRONE_ID_MESSAGE_PACK(OPEN_DRONE_ID_MESSAGE_PACK_DATA),
32671 #[doc = "Data for filling the OpenDroneID Operator ID message, which contains the CAA (Civil Aviation Authority) issued operator ID."]
32672 #[doc = ""]
32673 #[doc = "ID: 12905"]
32674 OPEN_DRONE_ID_OPERATOR_ID(OPEN_DRONE_ID_OPERATOR_ID_DATA),
32675 #[doc = "Data for filling the OpenDroneID Self ID message. The Self ID Message is an opportunity for the operator to (optionally) declare their identity and purpose of the flight. This message can provide additional information that could reduce the threat profile of a UA (Unmanned Aircraft) flying in a particular area or manner. This message can also be used to provide optional additional clarification in an emergency/remote ID system failure situation."]
32676 #[doc = ""]
32677 #[doc = "ID: 12903"]
32678 OPEN_DRONE_ID_SELF_ID(OPEN_DRONE_ID_SELF_ID_DATA),
32679 #[doc = "Data for filling the OpenDroneID System message. The System Message contains general system information including the operator location/altitude and possible aircraft group and/or category/class information."]
32680 #[doc = ""]
32681 #[doc = "ID: 12904"]
32682 OPEN_DRONE_ID_SYSTEM(OPEN_DRONE_ID_SYSTEM_DATA),
32683 #[doc = "Update the data in the OPEN_DRONE_ID_SYSTEM message with new location information. This can be sent to update the location information for the operator when no other information in the SYSTEM message has changed. This message allows for efficient operation on radio links which have limited uplink bandwidth while meeting requirements for update frequency of the operator location."]
32684 #[doc = ""]
32685 #[doc = "ID: 12919"]
32686 OPEN_DRONE_ID_SYSTEM_UPDATE(OPEN_DRONE_ID_SYSTEM_UPDATE_DATA),
32687 #[doc = "Optical flow from a flow sensor (e.g. optical mouse sensor)."]
32688 #[doc = ""]
32689 #[doc = "ID: 100"]
32690 OPTICAL_FLOW(OPTICAL_FLOW_DATA),
32691 #[doc = "Optical flow from an angular rate flow sensor (e.g. PX4FLOW or mouse sensor)."]
32692 #[doc = ""]
32693 #[doc = "ID: 106"]
32694 OPTICAL_FLOW_RAD(OPTICAL_FLOW_RAD_DATA),
32695 #[doc = "Vehicle status report that is sent out while orbit execution is in progress (see MAV_CMD_DO_ORBIT)."]
32696 #[doc = ""]
32697 #[doc = "ID: 360"]
32698 ORBIT_EXECUTION_STATUS(ORBIT_EXECUTION_STATUS_DATA),
32699 #[doc = "Response from a PARAM_EXT_SET message."]
32700 #[doc = ""]
32701 #[doc = "ID: 324"]
32702 PARAM_EXT_ACK(PARAM_EXT_ACK_DATA),
32703 #[doc = "Request all parameters of this component. All parameters should be emitted in response as PARAM_EXT_VALUE."]
32704 #[doc = ""]
32705 #[doc = "ID: 321"]
32706 PARAM_EXT_REQUEST_LIST(PARAM_EXT_REQUEST_LIST_DATA),
32707 #[doc = "Request to read the value of a parameter with either the param_id string id or param_index. PARAM_EXT_VALUE should be emitted in response."]
32708 #[doc = ""]
32709 #[doc = "ID: 320"]
32710 PARAM_EXT_REQUEST_READ(PARAM_EXT_REQUEST_READ_DATA),
32711 #[doc = "Set a parameter value. In order to deal with message loss (and retransmission of PARAM_EXT_SET), when setting a parameter value and the new value is the same as the current value, you will immediately get a PARAM_ACK_ACCEPTED response. If the current state is PARAM_ACK_IN_PROGRESS, you will accordingly receive a PARAM_ACK_IN_PROGRESS in response."]
32712 #[doc = ""]
32713 #[doc = "ID: 323"]
32714 PARAM_EXT_SET(PARAM_EXT_SET_DATA),
32715 #[doc = "Emit the value of a parameter. The inclusion of param_count and param_index in the message allows the recipient to keep track of received parameters and allows them to re-request missing parameters after a loss or timeout."]
32716 #[doc = ""]
32717 #[doc = "ID: 322"]
32718 PARAM_EXT_VALUE(PARAM_EXT_VALUE_DATA),
32719 #[doc = "Bind a RC channel to a parameter. The parameter should change according to the RC channel value."]
32720 #[doc = ""]
32721 #[doc = "ID: 50"]
32722 PARAM_MAP_RC(PARAM_MAP_RC_DATA),
32723 #[doc = "Request all parameters of this component. After this request, all parameters are emitted. The parameter microservice is documented at <https://mavlink.io/en/services/parameter.html>."]
32724 #[doc = ""]
32725 #[doc = "ID: 21"]
32726 PARAM_REQUEST_LIST(PARAM_REQUEST_LIST_DATA),
32727 #[doc = "value[float]. This allows to send a parameter to any other component (such as the GCS) without the need of previous knowledge of possible parameter names. Thus the same GCS can store different parameters for different autopilots. See also <https://mavlink.io/en/services/parameter.html> for a full documentation of QGroundControl and IMU code."]
32728 #[doc = ""]
32729 #[doc = "ID: 20"]
32730 PARAM_REQUEST_READ(PARAM_REQUEST_READ_DATA),
32731 #[doc = "Set a parameter value (write new value to permanent storage). The receiving component should acknowledge the new parameter value by broadcasting a PARAM_VALUE message (broadcasting ensures that multiple GCS all have an up-to-date list of all parameters). If the sending GCS did not receive a PARAM_VALUE within its timeout time, it should re-send the PARAM_SET message. The parameter microservice is documented at <https://mavlink.io/en/services/parameter.html>."]
32732 #[doc = ""]
32733 #[doc = "ID: 23"]
32734 PARAM_SET(PARAM_SET_DATA),
32735 #[doc = "Emit the value of a onboard parameter. The inclusion of param_count and param_index in the message allows the recipient to keep track of received parameters and allows him to re-request missing parameters after a loss or timeout. The parameter microservice is documented at <https://mavlink.io/en/services/parameter.html>."]
32736 #[doc = ""]
32737 #[doc = "ID: 22"]
32738 PARAM_VALUE(PARAM_VALUE_DATA),
32739 #[doc = "A ping message either requesting or responding to a ping. This allows to measure the system latencies, including serial port, radio modem and UDP connections. The ping microservice is documented at <https://mavlink.io/en/services/ping.html>."]
32740 #[doc = ""]
32741 #[doc = "ID: 4"]
32742 #[deprecated = "To be removed / merged with TIMESYNC. See `TIMESYNC` (Deprecated since 2011-08)"]
32743 PING(PING_DATA),
32744 #[doc = "Control vehicle tone generation (buzzer)."]
32745 #[doc = ""]
32746 #[doc = "ID: 258"]
32747 #[deprecated = "New version explicitly defines format. More interoperable. See `PLAY_TUNE_V2` (Deprecated since 2019-10)"]
32748 PLAY_TUNE(PLAY_TUNE_DATA),
32749 #[doc = "Play vehicle tone/tune (buzzer). Supersedes message PLAY_TUNE."]
32750 #[doc = ""]
32751 #[doc = "ID: 400"]
32752 PLAY_TUNE_V2(PLAY_TUNE_V2_DATA),
32753 #[doc = "Reports the current commanded vehicle position, velocity, and acceleration as specified by the autopilot. This should match the commands sent in SET_POSITION_TARGET_GLOBAL_INT if the vehicle is being controlled this way."]
32754 #[doc = ""]
32755 #[doc = "ID: 87"]
32756 POSITION_TARGET_GLOBAL_INT(POSITION_TARGET_GLOBAL_INT_DATA),
32757 #[doc = "Reports the current commanded vehicle position, velocity, and acceleration as specified by the autopilot. This should match the commands sent in SET_POSITION_TARGET_LOCAL_NED if the vehicle is being controlled this way."]
32758 #[doc = ""]
32759 #[doc = "ID: 85"]
32760 POSITION_TARGET_LOCAL_NED(POSITION_TARGET_LOCAL_NED_DATA),
32761 #[doc = "Power supply status."]
32762 #[doc = ""]
32763 #[doc = "ID: 125"]
32764 POWER_STATUS(POWER_STATUS_DATA),
32765 #[doc = "Version and capability of protocol version. This message can be requested with MAV_CMD_REQUEST_MESSAGE and is used as part of the handshaking to establish which MAVLink version should be used on the network. Every node should respond to a request for PROTOCOL_VERSION to enable the handshaking. Library implementers should consider adding this into the default decoding state machine to allow the protocol core to respond directly."]
32766 #[doc = ""]
32767 #[doc = "ID: 300"]
32768 PROTOCOL_VERSION(PROTOCOL_VERSION_DATA),
32769 #[doc = "Status generated by radio and injected into MAVLink stream."]
32770 #[doc = ""]
32771 #[doc = "ID: 109"]
32772 RADIO_STATUS(RADIO_STATUS_DATA),
32773 #[doc = "The RAW IMU readings for a 9DOF sensor, which is identified by the id (default IMU1). This message should always contain the true raw values without any scaling to allow data capture and system debugging."]
32774 #[doc = ""]
32775 #[doc = "ID: 27"]
32776 RAW_IMU(RAW_IMU_DATA),
32777 #[doc = "The RAW pressure readings for the typical setup of one absolute pressure and one differential pressure sensor. The sensor values should be the raw, UNSCALED ADC values."]
32778 #[doc = ""]
32779 #[doc = "ID: 28"]
32780 RAW_PRESSURE(RAW_PRESSURE_DATA),
32781 #[doc = "RPM sensor data message."]
32782 #[doc = ""]
32783 #[doc = "ID: 339"]
32784 RAW_RPM(RAW_RPM_DATA),
32785 #[doc = "The PPM values of the RC channels received. The standard PPM modulation is as follows: 1000 microseconds: 0%, 2000 microseconds: 100%. A value of UINT16_MAX implies the channel is unused. Individual receivers/transmitters might violate this specification."]
32786 #[doc = ""]
32787 #[doc = "ID: 65"]
32788 RC_CHANNELS(RC_CHANNELS_DATA),
32789 #[doc = "The RAW values of the RC channels sent to the MAV to override info received from the RC radio. The standard PPM modulation is as follows: 1000 microseconds: 0%, 2000 microseconds: 100%. Individual receivers/transmitters might violate this specification. Note carefully the semantic differences between the first 8 channels and the subsequent channels."]
32790 #[doc = ""]
32791 #[doc = "ID: 70"]
32792 RC_CHANNELS_OVERRIDE(RC_CHANNELS_OVERRIDE_DATA),
32793 #[doc = "The RAW values of the RC channels received. The standard PPM modulation is as follows: 1000 microseconds: 0%, 2000 microseconds: 100%. A value of UINT16_MAX implies the channel is unused. Individual receivers/transmitters might violate this specification."]
32794 #[doc = ""]
32795 #[doc = "ID: 35"]
32796 RC_CHANNELS_RAW(RC_CHANNELS_RAW_DATA),
32797 #[doc = "The scaled values of the RC channels received: (-100%) -10000, (0%) 0, (100%) 10000. Channels that are inactive should be set to INT16_MAX."]
32798 #[doc = ""]
32799 #[doc = "ID: 34"]
32800 RC_CHANNELS_SCALED(RC_CHANNELS_SCALED_DATA),
32801 #[doc = "Request a data stream."]
32802 #[doc = ""]
32803 #[doc = "ID: 66"]
32804 #[deprecated = " See `MAV_CMD_SET_MESSAGE_INTERVAL ` (Deprecated since 2015-08)"]
32805 REQUEST_DATA_STREAM(REQUEST_DATA_STREAM_DATA),
32806 #[doc = "Request one or more events to be (re-)sent. If first_sequence==last_sequence, only a single event is requested. Note that first_sequence can be larger than last_sequence (because the sequence number can wrap). Each sequence will trigger an EVENT or EVENT_ERROR response."]
32807 #[doc = ""]
32808 #[doc = "ID: 412"]
32809 REQUEST_EVENT(REQUEST_EVENT_DATA),
32810 #[doc = "The autopilot is requesting a resource (file, binary, other type of data)."]
32811 #[doc = ""]
32812 #[doc = "ID: 142"]
32813 RESOURCE_REQUEST(RESOURCE_REQUEST_DATA),
32814 #[doc = "Response to a REQUEST_EVENT in case of an error (e.g. the event is not available anymore)."]
32815 #[doc = ""]
32816 #[doc = "ID: 413"]
32817 RESPONSE_EVENT_ERROR(RESPONSE_EVENT_ERROR_DATA),
32818 #[doc = "Read out the safety zone the MAV currently assumes."]
32819 #[doc = ""]
32820 #[doc = "ID: 55"]
32821 SAFETY_ALLOWED_AREA(SAFETY_ALLOWED_AREA_DATA),
32822 #[doc = "Set a safety zone (volume), which is defined by two corners of a cube. This message can be used to tell the MAV which setpoints/waypoints to accept and which to reject. Safety areas are often enforced by national or competition regulations."]
32823 #[doc = ""]
32824 #[doc = "ID: 54"]
32825 SAFETY_SET_ALLOWED_AREA(SAFETY_SET_ALLOWED_AREA_DATA),
32826 #[doc = "The RAW IMU readings for the usual 9DOF sensor setup. This message should contain the scaled values to the described units."]
32827 #[doc = ""]
32828 #[doc = "ID: 26"]
32829 SCALED_IMU(SCALED_IMU_DATA),
32830 #[doc = "The RAW IMU readings for secondary 9DOF sensor setup. This message should contain the scaled values to the described units."]
32831 #[doc = ""]
32832 #[doc = "ID: 116"]
32833 SCALED_IMU2(SCALED_IMU2_DATA),
32834 #[doc = "The RAW IMU readings for 3rd 9DOF sensor setup. This message should contain the scaled values to the described units."]
32835 #[doc = ""]
32836 #[doc = "ID: 129"]
32837 SCALED_IMU3(SCALED_IMU3_DATA),
32838 #[doc = "The pressure readings for the typical setup of one absolute and differential pressure sensor. The units are as specified in each field."]
32839 #[doc = ""]
32840 #[doc = "ID: 29"]
32841 SCALED_PRESSURE(SCALED_PRESSURE_DATA),
32842 #[doc = "Barometer readings for 2nd barometer."]
32843 #[doc = ""]
32844 #[doc = "ID: 137"]
32845 SCALED_PRESSURE2(SCALED_PRESSURE2_DATA),
32846 #[doc = "Barometer readings for 3rd barometer."]
32847 #[doc = ""]
32848 #[doc = "ID: 143"]
32849 SCALED_PRESSURE3(SCALED_PRESSURE3_DATA),
32850 #[doc = "Control a serial port. This can be used for raw access to an onboard serial peripheral such as a GPS or telemetry radio. It is designed to make it possible to update the devices firmware via MAVLink messages or change the devices settings. A message with zero bytes can be used to change just the baudrate."]
32851 #[doc = ""]
32852 #[doc = "ID: 126"]
32853 SERIAL_CONTROL(SERIAL_CONTROL_DATA),
32854 #[doc = "Superseded by ACTUATOR_OUTPUT_STATUS. The RAW values of the servo outputs (for RC input from the remote, use the RC_CHANNELS messages). The standard PPM modulation is as follows: 1000 microseconds: 0%, 2000 microseconds: 100%."]
32855 #[doc = ""]
32856 #[doc = "ID: 36"]
32857 SERVO_OUTPUT_RAW(SERVO_OUTPUT_RAW_DATA),
32858 #[doc = "Setup a MAVLink2 signing key. If called with secret_key of all zero and zero initial_timestamp will disable signing."]
32859 #[doc = ""]
32860 #[doc = "ID: 256"]
32861 SETUP_SIGNING(SETUP_SIGNING_DATA),
32862 #[doc = "Set the vehicle attitude and body angular rates."]
32863 #[doc = ""]
32864 #[doc = "ID: 139"]
32865 SET_ACTUATOR_CONTROL_TARGET(SET_ACTUATOR_CONTROL_TARGET_DATA),
32866 #[doc = "Sets a desired vehicle attitude. Used by an external controller to command the vehicle (manual controller or other system)."]
32867 #[doc = ""]
32868 #[doc = "ID: 82"]
32869 SET_ATTITUDE_TARGET(SET_ATTITUDE_TARGET_DATA),
32870 #[doc = "Sets the GPS coordinates of the vehicle local origin (0,0,0) position. Vehicle should emit GPS_GLOBAL_ORIGIN irrespective of whether the origin is changed. This enables transform between the local coordinate frame and the global (GPS) coordinate frame, which may be necessary when (for example) indoor and outdoor settings are connected and the MAV should move from in- to outdoor."]
32871 #[doc = ""]
32872 #[doc = "ID: 48"]
32873 #[deprecated = " See `MAV_CMD_SET_GLOBAL_ORIGIN` (Deprecated since 2025-04)"]
32874 SET_GPS_GLOBAL_ORIGIN(SET_GPS_GLOBAL_ORIGIN_DATA),
32875 #[doc = "Sets the home position. \tThe home position is the default position that the system will return to and land on. The position is set automatically by the system during the takeoff (and may also be set using this message). The global and local positions encode the position in the respective coordinate frames, while the q parameter encodes the orientation of the surface. Under normal conditions it describes the heading and terrain slope, which can be used by the aircraft to adjust the approach. The approach 3D vector describes the point to which the system should fly in normal flight mode and then perform a landing sequence along the vector. Note: the current home position may be emitted in a HOME_POSITION message on request (using MAV_CMD_REQUEST_MESSAGE with param1=242)."]
32876 #[doc = ""]
32877 #[doc = "ID: 243"]
32878 #[deprecated = "The command protocol version (MAV_CMD_DO_SET_HOME) allows a GCS to detect when setting the home position has failed. See `MAV_CMD_DO_SET_HOME` (Deprecated since 2022-02)"]
32879 SET_HOME_POSITION(SET_HOME_POSITION_DATA),
32880 #[doc = "Set the system mode, as defined by enum MAV_MODE. There is no target component id as the mode is by definition for the overall aircraft, not only for one component."]
32881 #[doc = ""]
32882 #[doc = "ID: 11"]
32883 #[deprecated = "Use COMMAND_LONG with MAV_CMD_DO_SET_MODE instead. See `MAV_CMD_DO_SET_MODE` (Deprecated since 2015-12)"]
32884 SET_MODE(SET_MODE_DATA),
32885 #[doc = "Sets a desired vehicle position, velocity, and/or acceleration in a global coordinate system (WGS84). Used by an external controller to command the vehicle (manual controller or other system)."]
32886 #[doc = ""]
32887 #[doc = "ID: 86"]
32888 SET_POSITION_TARGET_GLOBAL_INT(SET_POSITION_TARGET_GLOBAL_INT_DATA),
32889 #[doc = "Sets a desired vehicle position in a local north-east-down coordinate frame. Used by an external controller to command the vehicle (manual controller or other system)."]
32890 #[doc = ""]
32891 #[doc = "ID: 84"]
32892 SET_POSITION_TARGET_LOCAL_NED(SET_POSITION_TARGET_LOCAL_NED_DATA),
32893 #[doc = "Status of simulation environment, if used."]
32894 #[doc = ""]
32895 #[doc = "ID: 108"]
32896 SIM_STATE(SIM_STATE_DATA),
32897 #[doc = "Smart Battery information (static/infrequent update). Use for updates from: smart battery to flight stack, flight stack to GCS. Use BATTERY_STATUS for the frequent battery updates."]
32898 #[doc = ""]
32899 #[doc = "ID: 370"]
32900 #[deprecated = "The BATTERY_INFO message is better aligned with UAVCAN messages, and in any case is useful even if a battery is not \"smart\". See `BATTERY_INFO` (Deprecated since 2024-02)"]
32901 SMART_BATTERY_INFO(SMART_BATTERY_INFO_DATA),
32902 #[doc = "Status text message. These messages are printed in yellow in the COMM console of QGroundControl. WARNING: They consume quite some bandwidth, so use only for important status and error messages. If implemented wisely, these messages are buffered on the MCU and sent only at a limited rate (e.g. 10 Hz)."]
32903 #[doc = ""]
32904 #[doc = "ID: 253"]
32905 STATUSTEXT(STATUSTEXT_DATA),
32906 #[doc = "Information about a storage medium. This message is sent in response to a request with MAV_CMD_REQUEST_MESSAGE and whenever the status of the storage changes (STORAGE_STATUS). Use MAV_CMD_REQUEST_MESSAGE.param2 to indicate the index/id of requested storage: 0 for all, 1 for first, 2 for second, etc."]
32907 #[doc = ""]
32908 #[doc = "ID: 261"]
32909 STORAGE_INFORMATION(STORAGE_INFORMATION_DATA),
32910 #[doc = "Tune formats supported by vehicle. This should be emitted as response to MAV_CMD_REQUEST_MESSAGE."]
32911 #[doc = ""]
32912 #[doc = "ID: 401"]
32913 SUPPORTED_TUNES(SUPPORTED_TUNES_DATA),
32914 #[doc = "The system time is the time of the master clock. This can be emitted by flight controllers, onboard computers, or other components in the MAVLink network. Components that are using a less reliable time source, such as a battery-backed real time clock, can choose to match their system clock to that of a SYSTEM_TYPE that indicates a more recent time. This allows more broadly accurate date stamping of logs, and so on. If precise time synchronization is needed then use TIMESYNC instead."]
32915 #[doc = ""]
32916 #[doc = "ID: 2"]
32917 SYSTEM_TIME(SYSTEM_TIME_DATA),
32918 #[doc = "The general system state. If the system is following the MAVLink standard, the system state is mainly defined by three orthogonal states/modes: The system mode, which is either LOCKED (motors shut down and locked), MANUAL (system under RC control), GUIDED (system with autonomous position control, position setpoint controlled manually) or AUTO (system guided by path/waypoint planner). The NAV_MODE defined the current flight state: LIFTOFF (often an open-loop maneuver), LANDING, WAYPOINTS or VECTOR. This represents the internal navigation state machine. The system status shows whether the system is currently active or not and if an emergency occurred. During the CRITICAL and EMERGENCY states the MAV is still considered to be active, but should start emergency procedures autonomously. After a failure occurred it should first move from active to critical to allow manual intervention and then move to emergency after a certain timeout."]
32919 #[doc = ""]
32920 #[doc = "ID: 1"]
32921 SYS_STATUS(SYS_STATUS_DATA),
32922 #[doc = "Request that the vehicle report terrain height at the given location (expected response is a TERRAIN_REPORT). Used by GCS to check if vehicle has all terrain data needed for a mission."]
32923 #[doc = ""]
32924 #[doc = "ID: 135"]
32925 TERRAIN_CHECK(TERRAIN_CHECK_DATA),
32926 #[doc = "Terrain data sent from GCS. The lat/lon and grid_spacing must be the same as a lat/lon from a TERRAIN_REQUEST. See terrain protocol docs: <https://mavlink.io/en/services/terrain.html>."]
32927 #[doc = ""]
32928 #[doc = "ID: 134"]
32929 TERRAIN_DATA(TERRAIN_DATA_DATA),
32930 #[doc = "Streamed from drone to report progress of terrain map download (initiated by TERRAIN_REQUEST), or sent as a response to a TERRAIN_CHECK request. See terrain protocol docs: <https://mavlink.io/en/services/terrain.html>."]
32931 #[doc = ""]
32932 #[doc = "ID: 136"]
32933 TERRAIN_REPORT(TERRAIN_REPORT_DATA),
32934 #[doc = "Request for terrain data and terrain status. See terrain protocol docs: <https://mavlink.io/en/services/terrain.html>."]
32935 #[doc = ""]
32936 #[doc = "ID: 133"]
32937 TERRAIN_REQUEST(TERRAIN_REQUEST_DATA),
32938 #[doc = "Time synchronization message. The message is used for both timesync requests and responses. The request is sent with `ts1=syncing component timestamp` and `tc1=0`, and may be broadcast or targeted to a specific system/component. The response is sent with `ts1=syncing component timestamp` (mirror back unchanged), and `tc1=responding component timestamp`, with the `target_system` and `target_component` set to ids of the original request. Systems can determine if they are receiving a request or response based on the value of `tc`. If the response has `target_system==target_component==0` the remote system has not been updated to use the component IDs and cannot reliably timesync; the requestor may report an error. Timestamps are UNIX Epoch time or time since system boot in nanoseconds (the timestamp format can be inferred by checking for the magnitude of the number; generally it doesn't matter as only the offset is used). The message sequence is repeated numerous times with results being filtered/averaged to estimate the offset. See also: <https://mavlink.io/en/services/timesync.html>."]
32939 #[doc = ""]
32940 #[doc = "ID: 111"]
32941 TIMESYNC(TIMESYNC_DATA),
32942 #[doc = "Time/duration estimates for various events and actions given the current vehicle state and position."]
32943 #[doc = ""]
32944 #[doc = "ID: 380"]
32945 TIME_ESTIMATE_TO_TARGET(TIME_ESTIMATE_TO_TARGET_DATA),
32946 #[doc = "Describe a trajectory using an array of up-to 5 bezier control points in the local frame (MAV_FRAME_LOCAL_NED)."]
32947 #[doc = ""]
32948 #[doc = "ID: 333"]
32949 TRAJECTORY_REPRESENTATION_BEZIER(TRAJECTORY_REPRESENTATION_BEZIER_DATA),
32950 #[doc = "Describe a trajectory using an array of up-to 5 waypoints in the local frame (MAV_FRAME_LOCAL_NED)."]
32951 #[doc = ""]
32952 #[doc = "ID: 332"]
32953 TRAJECTORY_REPRESENTATION_WAYPOINTS(TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA),
32954 #[doc = "Message for transporting \"arbitrary\" variable-length data from one component to another (broadcast is not forbidden, but discouraged). The encoding of the data is usually extension specific, i.e. determined by the source, and is usually not documented as part of the MAVLink specification."]
32955 #[doc = ""]
32956 #[doc = "ID: 385"]
32957 TUNNEL(TUNNEL_DATA),
32958 #[doc = "General information describing a particular UAVCAN node. Please refer to the definition of the UAVCAN service \"uavcan.protocol.GetNodeInfo\" for the background information. This message should be emitted by the system whenever a new node appears online, or an existing node reboots. Additionally, it can be emitted upon request from the other end of the MAVLink channel (see MAV_CMD_UAVCAN_GET_NODE_INFO). It is also not prohibited to emit this message unconditionally at a low frequency. The UAVCAN specification is available at <http://uavcan.org>."]
32959 #[doc = ""]
32960 #[doc = "ID: 311"]
32961 UAVCAN_NODE_INFO(UAVCAN_NODE_INFO_DATA),
32962 #[doc = "General status information of an UAVCAN node. Please refer to the definition of the UAVCAN message \"uavcan.protocol.NodeStatus\" for the background information. The UAVCAN specification is available at <http://uavcan.org>."]
32963 #[doc = ""]
32964 #[doc = "ID: 310"]
32965 UAVCAN_NODE_STATUS(UAVCAN_NODE_STATUS_DATA),
32966 #[doc = "The global position resulting from GPS and sensor fusion."]
32967 #[doc = ""]
32968 #[doc = "ID: 340"]
32969 UTM_GLOBAL_POSITION(UTM_GLOBAL_POSITION_DATA),
32970 #[doc = "Message implementing parts of the V2 payload specs in V1 frames for transitional support."]
32971 #[doc = ""]
32972 #[doc = "ID: 248"]
32973 V2_EXTENSION(V2_EXTENSION_DATA),
32974 #[doc = "Metrics typically displayed on a HUD for fixed wing aircraft."]
32975 #[doc = ""]
32976 #[doc = "ID: 74"]
32977 VFR_HUD(VFR_HUD_DATA),
32978 #[doc = "Vibration levels and accelerometer clipping."]
32979 #[doc = ""]
32980 #[doc = "ID: 241"]
32981 VIBRATION(VIBRATION_DATA),
32982 #[doc = "Global position estimate from a Vicon motion system source."]
32983 #[doc = ""]
32984 #[doc = "ID: 104"]
32985 VICON_POSITION_ESTIMATE(VICON_POSITION_ESTIMATE_DATA),
32986 #[doc = "Information about video stream. It may be requested using MAV_CMD_REQUEST_MESSAGE, where param2 indicates the video stream id: 0 for all streams, 1 for first, 2 for second, etc."]
32987 #[doc = ""]
32988 #[doc = "ID: 269"]
32989 VIDEO_STREAM_INFORMATION(VIDEO_STREAM_INFORMATION_DATA),
32990 #[doc = "Information about the status of a video stream. It may be requested using MAV_CMD_REQUEST_MESSAGE."]
32991 #[doc = ""]
32992 #[doc = "ID: 270"]
32993 VIDEO_STREAM_STATUS(VIDEO_STREAM_STATUS_DATA),
32994 #[doc = "Local position/attitude estimate from a vision source."]
32995 #[doc = ""]
32996 #[doc = "ID: 102"]
32997 VISION_POSITION_ESTIMATE(VISION_POSITION_ESTIMATE_DATA),
32998 #[doc = "Speed estimate from a vision source."]
32999 #[doc = ""]
33000 #[doc = "ID: 103"]
33001 VISION_SPEED_ESTIMATE(VISION_SPEED_ESTIMATE_DATA),
33002 #[doc = "Cumulative distance traveled for each reported wheel."]
33003 #[doc = ""]
33004 #[doc = "ID: 9000"]
33005 WHEEL_DISTANCE(WHEEL_DISTANCE_DATA),
33006 #[doc = "Configure WiFi AP SSID, password, and mode. This message is re-emitted as an acknowledgement by the AP. The message may also be explicitly requested using MAV_CMD_REQUEST_MESSAGE."]
33007 #[doc = ""]
33008 #[doc = "ID: 299"]
33009 WIFI_CONFIG_AP(WIFI_CONFIG_AP_DATA),
33010 #[doc = "Winch status."]
33011 #[doc = ""]
33012 #[doc = "ID: 9005"]
33013 WINCH_STATUS(WINCH_STATUS_DATA),
33014 #[doc = "Wind estimate from vehicle. Note that despite the name, this message does not actually contain any covariances but instead variability and accuracy fields in terms of standard deviation (1-STD)."]
33015 #[doc = ""]
33016 #[doc = "ID: 231"]
33017 WIND_COV(WIND_COV_DATA),
33018}
33019impl MavMessage {
33020 pub const fn all_ids() -> &'static [u32] {
33021 &[
33022 0u32, 1u32, 2u32, 4u32, 5u32, 6u32, 7u32, 8u32, 11u32, 20u32, 21u32, 22u32, 23u32,
33023 24u32, 25u32, 26u32, 27u32, 28u32, 29u32, 30u32, 31u32, 32u32, 33u32, 34u32, 35u32,
33024 36u32, 37u32, 38u32, 39u32, 40u32, 41u32, 42u32, 43u32, 44u32, 45u32, 46u32, 47u32,
33025 48u32, 49u32, 50u32, 51u32, 54u32, 55u32, 61u32, 62u32, 63u32, 64u32, 65u32, 66u32,
33026 67u32, 69u32, 70u32, 73u32, 74u32, 75u32, 76u32, 77u32, 80u32, 81u32, 82u32, 83u32,
33027 84u32, 85u32, 86u32, 87u32, 89u32, 90u32, 91u32, 92u32, 93u32, 100u32, 101u32, 102u32,
33028 103u32, 104u32, 105u32, 106u32, 107u32, 108u32, 109u32, 110u32, 111u32, 112u32, 113u32,
33029 114u32, 115u32, 116u32, 117u32, 118u32, 119u32, 120u32, 121u32, 122u32, 123u32, 124u32,
33030 125u32, 126u32, 127u32, 128u32, 129u32, 130u32, 131u32, 132u32, 133u32, 134u32, 135u32,
33031 136u32, 137u32, 138u32, 139u32, 140u32, 141u32, 142u32, 143u32, 144u32, 146u32, 147u32,
33032 148u32, 149u32, 162u32, 192u32, 225u32, 230u32, 231u32, 232u32, 233u32, 234u32, 235u32,
33033 241u32, 242u32, 243u32, 244u32, 245u32, 246u32, 247u32, 248u32, 249u32, 250u32, 251u32,
33034 252u32, 253u32, 254u32, 256u32, 257u32, 258u32, 259u32, 260u32, 261u32, 262u32, 263u32,
33035 264u32, 265u32, 266u32, 267u32, 268u32, 269u32, 270u32, 271u32, 275u32, 276u32, 277u32,
33036 280u32, 281u32, 282u32, 283u32, 284u32, 285u32, 286u32, 287u32, 288u32, 290u32, 291u32,
33037 299u32, 300u32, 301u32, 310u32, 311u32, 320u32, 321u32, 322u32, 323u32, 324u32, 330u32,
33038 331u32, 332u32, 333u32, 334u32, 335u32, 336u32, 339u32, 340u32, 350u32, 360u32, 370u32,
33039 371u32, 372u32, 373u32, 375u32, 380u32, 385u32, 386u32, 387u32, 388u32, 390u32, 395u32,
33040 396u32, 397u32, 400u32, 401u32, 410u32, 411u32, 412u32, 413u32, 435u32, 436u32, 437u32,
33041 440u32, 9000u32, 9005u32, 12900u32, 12901u32, 12902u32, 12903u32, 12904u32, 12905u32,
33042 12915u32, 12918u32, 12919u32, 12920u32,
33043 ]
33044 }
33045}
33046impl Message for MavMessage {
33047 fn parse(
33048 version: MavlinkVersion,
33049 id: u32,
33050 payload: &[u8],
33051 ) -> Result<Self, ::mavlink_core::error::ParserError> {
33052 match id {
33053 ACTUATOR_CONTROL_TARGET_DATA::ID => {
33054 ACTUATOR_CONTROL_TARGET_DATA::deser(version, payload)
33055 .map(Self::ACTUATOR_CONTROL_TARGET)
33056 }
33057 ACTUATOR_OUTPUT_STATUS_DATA::ID => ACTUATOR_OUTPUT_STATUS_DATA::deser(version, payload)
33058 .map(Self::ACTUATOR_OUTPUT_STATUS),
33059 ADSB_VEHICLE_DATA::ID => {
33060 ADSB_VEHICLE_DATA::deser(version, payload).map(Self::ADSB_VEHICLE)
33061 }
33062 AIS_VESSEL_DATA::ID => AIS_VESSEL_DATA::deser(version, payload).map(Self::AIS_VESSEL),
33063 ALTITUDE_DATA::ID => ALTITUDE_DATA::deser(version, payload).map(Self::ALTITUDE),
33064 ATTITUDE_DATA::ID => ATTITUDE_DATA::deser(version, payload).map(Self::ATTITUDE),
33065 ATTITUDE_QUATERNION_DATA::ID => {
33066 ATTITUDE_QUATERNION_DATA::deser(version, payload).map(Self::ATTITUDE_QUATERNION)
33067 }
33068 ATTITUDE_QUATERNION_COV_DATA::ID => {
33069 ATTITUDE_QUATERNION_COV_DATA::deser(version, payload)
33070 .map(Self::ATTITUDE_QUATERNION_COV)
33071 }
33072 ATTITUDE_TARGET_DATA::ID => {
33073 ATTITUDE_TARGET_DATA::deser(version, payload).map(Self::ATTITUDE_TARGET)
33074 }
33075 ATT_POS_MOCAP_DATA::ID => {
33076 ATT_POS_MOCAP_DATA::deser(version, payload).map(Self::ATT_POS_MOCAP)
33077 }
33078 AUTH_KEY_DATA::ID => AUTH_KEY_DATA::deser(version, payload).map(Self::AUTH_KEY),
33079 AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA::ID => {
33080 AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA::deser(version, payload)
33081 .map(Self::AUTOPILOT_STATE_FOR_GIMBAL_DEVICE)
33082 }
33083 AUTOPILOT_VERSION_DATA::ID => {
33084 AUTOPILOT_VERSION_DATA::deser(version, payload).map(Self::AUTOPILOT_VERSION)
33085 }
33086 AVAILABLE_MODES_DATA::ID => {
33087 AVAILABLE_MODES_DATA::deser(version, payload).map(Self::AVAILABLE_MODES)
33088 }
33089 AVAILABLE_MODES_MONITOR_DATA::ID => {
33090 AVAILABLE_MODES_MONITOR_DATA::deser(version, payload)
33091 .map(Self::AVAILABLE_MODES_MONITOR)
33092 }
33093 BATTERY_INFO_DATA::ID => {
33094 BATTERY_INFO_DATA::deser(version, payload).map(Self::BATTERY_INFO)
33095 }
33096 BATTERY_STATUS_DATA::ID => {
33097 BATTERY_STATUS_DATA::deser(version, payload).map(Self::BATTERY_STATUS)
33098 }
33099 BUTTON_CHANGE_DATA::ID => {
33100 BUTTON_CHANGE_DATA::deser(version, payload).map(Self::BUTTON_CHANGE)
33101 }
33102 CAMERA_CAPTURE_STATUS_DATA::ID => {
33103 CAMERA_CAPTURE_STATUS_DATA::deser(version, payload).map(Self::CAMERA_CAPTURE_STATUS)
33104 }
33105 CAMERA_FOV_STATUS_DATA::ID => {
33106 CAMERA_FOV_STATUS_DATA::deser(version, payload).map(Self::CAMERA_FOV_STATUS)
33107 }
33108 CAMERA_IMAGE_CAPTURED_DATA::ID => {
33109 CAMERA_IMAGE_CAPTURED_DATA::deser(version, payload).map(Self::CAMERA_IMAGE_CAPTURED)
33110 }
33111 CAMERA_INFORMATION_DATA::ID => {
33112 CAMERA_INFORMATION_DATA::deser(version, payload).map(Self::CAMERA_INFORMATION)
33113 }
33114 CAMERA_SETTINGS_DATA::ID => {
33115 CAMERA_SETTINGS_DATA::deser(version, payload).map(Self::CAMERA_SETTINGS)
33116 }
33117 CAMERA_THERMAL_RANGE_DATA::ID => {
33118 CAMERA_THERMAL_RANGE_DATA::deser(version, payload).map(Self::CAMERA_THERMAL_RANGE)
33119 }
33120 CAMERA_TRACKING_GEO_STATUS_DATA::ID => {
33121 CAMERA_TRACKING_GEO_STATUS_DATA::deser(version, payload)
33122 .map(Self::CAMERA_TRACKING_GEO_STATUS)
33123 }
33124 CAMERA_TRACKING_IMAGE_STATUS_DATA::ID => {
33125 CAMERA_TRACKING_IMAGE_STATUS_DATA::deser(version, payload)
33126 .map(Self::CAMERA_TRACKING_IMAGE_STATUS)
33127 }
33128 CAMERA_TRIGGER_DATA::ID => {
33129 CAMERA_TRIGGER_DATA::deser(version, payload).map(Self::CAMERA_TRIGGER)
33130 }
33131 CANFD_FRAME_DATA::ID => {
33132 CANFD_FRAME_DATA::deser(version, payload).map(Self::CANFD_FRAME)
33133 }
33134 CAN_FILTER_MODIFY_DATA::ID => {
33135 CAN_FILTER_MODIFY_DATA::deser(version, payload).map(Self::CAN_FILTER_MODIFY)
33136 }
33137 CAN_FRAME_DATA::ID => CAN_FRAME_DATA::deser(version, payload).map(Self::CAN_FRAME),
33138 CELLULAR_CONFIG_DATA::ID => {
33139 CELLULAR_CONFIG_DATA::deser(version, payload).map(Self::CELLULAR_CONFIG)
33140 }
33141 CELLULAR_STATUS_DATA::ID => {
33142 CELLULAR_STATUS_DATA::deser(version, payload).map(Self::CELLULAR_STATUS)
33143 }
33144 CHANGE_OPERATOR_CONTROL_DATA::ID => {
33145 CHANGE_OPERATOR_CONTROL_DATA::deser(version, payload)
33146 .map(Self::CHANGE_OPERATOR_CONTROL)
33147 }
33148 CHANGE_OPERATOR_CONTROL_ACK_DATA::ID => {
33149 CHANGE_OPERATOR_CONTROL_ACK_DATA::deser(version, payload)
33150 .map(Self::CHANGE_OPERATOR_CONTROL_ACK)
33151 }
33152 COLLISION_DATA::ID => COLLISION_DATA::deser(version, payload).map(Self::COLLISION),
33153 COMMAND_ACK_DATA::ID => {
33154 COMMAND_ACK_DATA::deser(version, payload).map(Self::COMMAND_ACK)
33155 }
33156 COMMAND_CANCEL_DATA::ID => {
33157 COMMAND_CANCEL_DATA::deser(version, payload).map(Self::COMMAND_CANCEL)
33158 }
33159 COMMAND_INT_DATA::ID => {
33160 COMMAND_INT_DATA::deser(version, payload).map(Self::COMMAND_INT)
33161 }
33162 COMMAND_LONG_DATA::ID => {
33163 COMMAND_LONG_DATA::deser(version, payload).map(Self::COMMAND_LONG)
33164 }
33165 COMPONENT_INFORMATION_DATA::ID => {
33166 COMPONENT_INFORMATION_DATA::deser(version, payload).map(Self::COMPONENT_INFORMATION)
33167 }
33168 COMPONENT_INFORMATION_BASIC_DATA::ID => {
33169 COMPONENT_INFORMATION_BASIC_DATA::deser(version, payload)
33170 .map(Self::COMPONENT_INFORMATION_BASIC)
33171 }
33172 COMPONENT_METADATA_DATA::ID => {
33173 COMPONENT_METADATA_DATA::deser(version, payload).map(Self::COMPONENT_METADATA)
33174 }
33175 CONTROL_SYSTEM_STATE_DATA::ID => {
33176 CONTROL_SYSTEM_STATE_DATA::deser(version, payload).map(Self::CONTROL_SYSTEM_STATE)
33177 }
33178 CURRENT_EVENT_SEQUENCE_DATA::ID => CURRENT_EVENT_SEQUENCE_DATA::deser(version, payload)
33179 .map(Self::CURRENT_EVENT_SEQUENCE),
33180 CURRENT_MODE_DATA::ID => {
33181 CURRENT_MODE_DATA::deser(version, payload).map(Self::CURRENT_MODE)
33182 }
33183 DATA_STREAM_DATA::ID => {
33184 DATA_STREAM_DATA::deser(version, payload).map(Self::DATA_STREAM)
33185 }
33186 DATA_TRANSMISSION_HANDSHAKE_DATA::ID => {
33187 DATA_TRANSMISSION_HANDSHAKE_DATA::deser(version, payload)
33188 .map(Self::DATA_TRANSMISSION_HANDSHAKE)
33189 }
33190 DEBUG_DATA::ID => DEBUG_DATA::deser(version, payload).map(Self::DEBUG),
33191 DEBUG_FLOAT_ARRAY_DATA::ID => {
33192 DEBUG_FLOAT_ARRAY_DATA::deser(version, payload).map(Self::DEBUG_FLOAT_ARRAY)
33193 }
33194 DEBUG_VECT_DATA::ID => DEBUG_VECT_DATA::deser(version, payload).map(Self::DEBUG_VECT),
33195 DISTANCE_SENSOR_DATA::ID => {
33196 DISTANCE_SENSOR_DATA::deser(version, payload).map(Self::DISTANCE_SENSOR)
33197 }
33198 EFI_STATUS_DATA::ID => EFI_STATUS_DATA::deser(version, payload).map(Self::EFI_STATUS),
33199 ENCAPSULATED_DATA_DATA::ID => {
33200 ENCAPSULATED_DATA_DATA::deser(version, payload).map(Self::ENCAPSULATED_DATA)
33201 }
33202 ESC_INFO_DATA::ID => ESC_INFO_DATA::deser(version, payload).map(Self::ESC_INFO),
33203 ESC_STATUS_DATA::ID => ESC_STATUS_DATA::deser(version, payload).map(Self::ESC_STATUS),
33204 ESTIMATOR_STATUS_DATA::ID => {
33205 ESTIMATOR_STATUS_DATA::deser(version, payload).map(Self::ESTIMATOR_STATUS)
33206 }
33207 EVENT_DATA::ID => EVENT_DATA::deser(version, payload).map(Self::EVENT),
33208 EXTENDED_SYS_STATE_DATA::ID => {
33209 EXTENDED_SYS_STATE_DATA::deser(version, payload).map(Self::EXTENDED_SYS_STATE)
33210 }
33211 FENCE_STATUS_DATA::ID => {
33212 FENCE_STATUS_DATA::deser(version, payload).map(Self::FENCE_STATUS)
33213 }
33214 FILE_TRANSFER_PROTOCOL_DATA::ID => FILE_TRANSFER_PROTOCOL_DATA::deser(version, payload)
33215 .map(Self::FILE_TRANSFER_PROTOCOL),
33216 FLIGHT_INFORMATION_DATA::ID => {
33217 FLIGHT_INFORMATION_DATA::deser(version, payload).map(Self::FLIGHT_INFORMATION)
33218 }
33219 FOLLOW_TARGET_DATA::ID => {
33220 FOLLOW_TARGET_DATA::deser(version, payload).map(Self::FOLLOW_TARGET)
33221 }
33222 FUEL_STATUS_DATA::ID => {
33223 FUEL_STATUS_DATA::deser(version, payload).map(Self::FUEL_STATUS)
33224 }
33225 GENERATOR_STATUS_DATA::ID => {
33226 GENERATOR_STATUS_DATA::deser(version, payload).map(Self::GENERATOR_STATUS)
33227 }
33228 GIMBAL_DEVICE_ATTITUDE_STATUS_DATA::ID => {
33229 GIMBAL_DEVICE_ATTITUDE_STATUS_DATA::deser(version, payload)
33230 .map(Self::GIMBAL_DEVICE_ATTITUDE_STATUS)
33231 }
33232 GIMBAL_DEVICE_INFORMATION_DATA::ID => {
33233 GIMBAL_DEVICE_INFORMATION_DATA::deser(version, payload)
33234 .map(Self::GIMBAL_DEVICE_INFORMATION)
33235 }
33236 GIMBAL_DEVICE_SET_ATTITUDE_DATA::ID => {
33237 GIMBAL_DEVICE_SET_ATTITUDE_DATA::deser(version, payload)
33238 .map(Self::GIMBAL_DEVICE_SET_ATTITUDE)
33239 }
33240 GIMBAL_MANAGER_INFORMATION_DATA::ID => {
33241 GIMBAL_MANAGER_INFORMATION_DATA::deser(version, payload)
33242 .map(Self::GIMBAL_MANAGER_INFORMATION)
33243 }
33244 GIMBAL_MANAGER_SET_ATTITUDE_DATA::ID => {
33245 GIMBAL_MANAGER_SET_ATTITUDE_DATA::deser(version, payload)
33246 .map(Self::GIMBAL_MANAGER_SET_ATTITUDE)
33247 }
33248 GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA::ID => {
33249 GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA::deser(version, payload)
33250 .map(Self::GIMBAL_MANAGER_SET_MANUAL_CONTROL)
33251 }
33252 GIMBAL_MANAGER_SET_PITCHYAW_DATA::ID => {
33253 GIMBAL_MANAGER_SET_PITCHYAW_DATA::deser(version, payload)
33254 .map(Self::GIMBAL_MANAGER_SET_PITCHYAW)
33255 }
33256 GIMBAL_MANAGER_STATUS_DATA::ID => {
33257 GIMBAL_MANAGER_STATUS_DATA::deser(version, payload).map(Self::GIMBAL_MANAGER_STATUS)
33258 }
33259 GLOBAL_POSITION_INT_DATA::ID => {
33260 GLOBAL_POSITION_INT_DATA::deser(version, payload).map(Self::GLOBAL_POSITION_INT)
33261 }
33262 GLOBAL_POSITION_INT_COV_DATA::ID => {
33263 GLOBAL_POSITION_INT_COV_DATA::deser(version, payload)
33264 .map(Self::GLOBAL_POSITION_INT_COV)
33265 }
33266 GLOBAL_VISION_POSITION_ESTIMATE_DATA::ID => {
33267 GLOBAL_VISION_POSITION_ESTIMATE_DATA::deser(version, payload)
33268 .map(Self::GLOBAL_VISION_POSITION_ESTIMATE)
33269 }
33270 GPS2_RAW_DATA::ID => GPS2_RAW_DATA::deser(version, payload).map(Self::GPS2_RAW),
33271 GPS2_RTK_DATA::ID => GPS2_RTK_DATA::deser(version, payload).map(Self::GPS2_RTK),
33272 GPS_GLOBAL_ORIGIN_DATA::ID => {
33273 GPS_GLOBAL_ORIGIN_DATA::deser(version, payload).map(Self::GPS_GLOBAL_ORIGIN)
33274 }
33275 GPS_INJECT_DATA_DATA::ID => {
33276 GPS_INJECT_DATA_DATA::deser(version, payload).map(Self::GPS_INJECT_DATA)
33277 }
33278 GPS_INPUT_DATA::ID => GPS_INPUT_DATA::deser(version, payload).map(Self::GPS_INPUT),
33279 GPS_RAW_INT_DATA::ID => {
33280 GPS_RAW_INT_DATA::deser(version, payload).map(Self::GPS_RAW_INT)
33281 }
33282 GPS_RTCM_DATA_DATA::ID => {
33283 GPS_RTCM_DATA_DATA::deser(version, payload).map(Self::GPS_RTCM_DATA)
33284 }
33285 GPS_RTK_DATA::ID => GPS_RTK_DATA::deser(version, payload).map(Self::GPS_RTK),
33286 GPS_STATUS_DATA::ID => GPS_STATUS_DATA::deser(version, payload).map(Self::GPS_STATUS),
33287 HEARTBEAT_DATA::ID => HEARTBEAT_DATA::deser(version, payload).map(Self::HEARTBEAT),
33288 HIGHRES_IMU_DATA::ID => {
33289 HIGHRES_IMU_DATA::deser(version, payload).map(Self::HIGHRES_IMU)
33290 }
33291 HIGH_LATENCY_DATA::ID => {
33292 HIGH_LATENCY_DATA::deser(version, payload).map(Self::HIGH_LATENCY)
33293 }
33294 HIGH_LATENCY2_DATA::ID => {
33295 HIGH_LATENCY2_DATA::deser(version, payload).map(Self::HIGH_LATENCY2)
33296 }
33297 HIL_ACTUATOR_CONTROLS_DATA::ID => {
33298 HIL_ACTUATOR_CONTROLS_DATA::deser(version, payload).map(Self::HIL_ACTUATOR_CONTROLS)
33299 }
33300 HIL_CONTROLS_DATA::ID => {
33301 HIL_CONTROLS_DATA::deser(version, payload).map(Self::HIL_CONTROLS)
33302 }
33303 HIL_GPS_DATA::ID => HIL_GPS_DATA::deser(version, payload).map(Self::HIL_GPS),
33304 HIL_OPTICAL_FLOW_DATA::ID => {
33305 HIL_OPTICAL_FLOW_DATA::deser(version, payload).map(Self::HIL_OPTICAL_FLOW)
33306 }
33307 HIL_RC_INPUTS_RAW_DATA::ID => {
33308 HIL_RC_INPUTS_RAW_DATA::deser(version, payload).map(Self::HIL_RC_INPUTS_RAW)
33309 }
33310 HIL_SENSOR_DATA::ID => HIL_SENSOR_DATA::deser(version, payload).map(Self::HIL_SENSOR),
33311 HIL_STATE_DATA::ID => HIL_STATE_DATA::deser(version, payload).map(Self::HIL_STATE),
33312 HIL_STATE_QUATERNION_DATA::ID => {
33313 HIL_STATE_QUATERNION_DATA::deser(version, payload).map(Self::HIL_STATE_QUATERNION)
33314 }
33315 HOME_POSITION_DATA::ID => {
33316 HOME_POSITION_DATA::deser(version, payload).map(Self::HOME_POSITION)
33317 }
33318 HYGROMETER_SENSOR_DATA::ID => {
33319 HYGROMETER_SENSOR_DATA::deser(version, payload).map(Self::HYGROMETER_SENSOR)
33320 }
33321 ILLUMINATOR_STATUS_DATA::ID => {
33322 ILLUMINATOR_STATUS_DATA::deser(version, payload).map(Self::ILLUMINATOR_STATUS)
33323 }
33324 ISBD_LINK_STATUS_DATA::ID => {
33325 ISBD_LINK_STATUS_DATA::deser(version, payload).map(Self::ISBD_LINK_STATUS)
33326 }
33327 LANDING_TARGET_DATA::ID => {
33328 LANDING_TARGET_DATA::deser(version, payload).map(Self::LANDING_TARGET)
33329 }
33330 LINK_NODE_STATUS_DATA::ID => {
33331 LINK_NODE_STATUS_DATA::deser(version, payload).map(Self::LINK_NODE_STATUS)
33332 }
33333 LOCAL_POSITION_NED_DATA::ID => {
33334 LOCAL_POSITION_NED_DATA::deser(version, payload).map(Self::LOCAL_POSITION_NED)
33335 }
33336 LOCAL_POSITION_NED_COV_DATA::ID => LOCAL_POSITION_NED_COV_DATA::deser(version, payload)
33337 .map(Self::LOCAL_POSITION_NED_COV),
33338 LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA::ID => {
33339 LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA::deser(version, payload)
33340 .map(Self::LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET)
33341 }
33342 LOGGING_ACK_DATA::ID => {
33343 LOGGING_ACK_DATA::deser(version, payload).map(Self::LOGGING_ACK)
33344 }
33345 LOGGING_DATA_DATA::ID => {
33346 LOGGING_DATA_DATA::deser(version, payload).map(Self::LOGGING_DATA)
33347 }
33348 LOGGING_DATA_ACKED_DATA::ID => {
33349 LOGGING_DATA_ACKED_DATA::deser(version, payload).map(Self::LOGGING_DATA_ACKED)
33350 }
33351 LOG_DATA_DATA::ID => LOG_DATA_DATA::deser(version, payload).map(Self::LOG_DATA),
33352 LOG_ENTRY_DATA::ID => LOG_ENTRY_DATA::deser(version, payload).map(Self::LOG_ENTRY),
33353 LOG_ERASE_DATA::ID => LOG_ERASE_DATA::deser(version, payload).map(Self::LOG_ERASE),
33354 LOG_REQUEST_DATA_DATA::ID => {
33355 LOG_REQUEST_DATA_DATA::deser(version, payload).map(Self::LOG_REQUEST_DATA)
33356 }
33357 LOG_REQUEST_END_DATA::ID => {
33358 LOG_REQUEST_END_DATA::deser(version, payload).map(Self::LOG_REQUEST_END)
33359 }
33360 LOG_REQUEST_LIST_DATA::ID => {
33361 LOG_REQUEST_LIST_DATA::deser(version, payload).map(Self::LOG_REQUEST_LIST)
33362 }
33363 MAG_CAL_REPORT_DATA::ID => {
33364 MAG_CAL_REPORT_DATA::deser(version, payload).map(Self::MAG_CAL_REPORT)
33365 }
33366 MANUAL_CONTROL_DATA::ID => {
33367 MANUAL_CONTROL_DATA::deser(version, payload).map(Self::MANUAL_CONTROL)
33368 }
33369 MANUAL_SETPOINT_DATA::ID => {
33370 MANUAL_SETPOINT_DATA::deser(version, payload).map(Self::MANUAL_SETPOINT)
33371 }
33372 MEMORY_VECT_DATA::ID => {
33373 MEMORY_VECT_DATA::deser(version, payload).map(Self::MEMORY_VECT)
33374 }
33375 MESSAGE_INTERVAL_DATA::ID => {
33376 MESSAGE_INTERVAL_DATA::deser(version, payload).map(Self::MESSAGE_INTERVAL)
33377 }
33378 MISSION_ACK_DATA::ID => {
33379 MISSION_ACK_DATA::deser(version, payload).map(Self::MISSION_ACK)
33380 }
33381 MISSION_CLEAR_ALL_DATA::ID => {
33382 MISSION_CLEAR_ALL_DATA::deser(version, payload).map(Self::MISSION_CLEAR_ALL)
33383 }
33384 MISSION_COUNT_DATA::ID => {
33385 MISSION_COUNT_DATA::deser(version, payload).map(Self::MISSION_COUNT)
33386 }
33387 MISSION_CURRENT_DATA::ID => {
33388 MISSION_CURRENT_DATA::deser(version, payload).map(Self::MISSION_CURRENT)
33389 }
33390 MISSION_ITEM_DATA::ID => {
33391 MISSION_ITEM_DATA::deser(version, payload).map(Self::MISSION_ITEM)
33392 }
33393 MISSION_ITEM_INT_DATA::ID => {
33394 MISSION_ITEM_INT_DATA::deser(version, payload).map(Self::MISSION_ITEM_INT)
33395 }
33396 MISSION_ITEM_REACHED_DATA::ID => {
33397 MISSION_ITEM_REACHED_DATA::deser(version, payload).map(Self::MISSION_ITEM_REACHED)
33398 }
33399 MISSION_REQUEST_DATA::ID => {
33400 MISSION_REQUEST_DATA::deser(version, payload).map(Self::MISSION_REQUEST)
33401 }
33402 MISSION_REQUEST_INT_DATA::ID => {
33403 MISSION_REQUEST_INT_DATA::deser(version, payload).map(Self::MISSION_REQUEST_INT)
33404 }
33405 MISSION_REQUEST_LIST_DATA::ID => {
33406 MISSION_REQUEST_LIST_DATA::deser(version, payload).map(Self::MISSION_REQUEST_LIST)
33407 }
33408 MISSION_REQUEST_PARTIAL_LIST_DATA::ID => {
33409 MISSION_REQUEST_PARTIAL_LIST_DATA::deser(version, payload)
33410 .map(Self::MISSION_REQUEST_PARTIAL_LIST)
33411 }
33412 MISSION_SET_CURRENT_DATA::ID => {
33413 MISSION_SET_CURRENT_DATA::deser(version, payload).map(Self::MISSION_SET_CURRENT)
33414 }
33415 MISSION_WRITE_PARTIAL_LIST_DATA::ID => {
33416 MISSION_WRITE_PARTIAL_LIST_DATA::deser(version, payload)
33417 .map(Self::MISSION_WRITE_PARTIAL_LIST)
33418 }
33419 MOUNT_ORIENTATION_DATA::ID => {
33420 MOUNT_ORIENTATION_DATA::deser(version, payload).map(Self::MOUNT_ORIENTATION)
33421 }
33422 NAMED_VALUE_FLOAT_DATA::ID => {
33423 NAMED_VALUE_FLOAT_DATA::deser(version, payload).map(Self::NAMED_VALUE_FLOAT)
33424 }
33425 NAMED_VALUE_INT_DATA::ID => {
33426 NAMED_VALUE_INT_DATA::deser(version, payload).map(Self::NAMED_VALUE_INT)
33427 }
33428 NAV_CONTROLLER_OUTPUT_DATA::ID => {
33429 NAV_CONTROLLER_OUTPUT_DATA::deser(version, payload).map(Self::NAV_CONTROLLER_OUTPUT)
33430 }
33431 OBSTACLE_DISTANCE_DATA::ID => {
33432 OBSTACLE_DISTANCE_DATA::deser(version, payload).map(Self::OBSTACLE_DISTANCE)
33433 }
33434 ODOMETRY_DATA::ID => ODOMETRY_DATA::deser(version, payload).map(Self::ODOMETRY),
33435 ONBOARD_COMPUTER_STATUS_DATA::ID => {
33436 ONBOARD_COMPUTER_STATUS_DATA::deser(version, payload)
33437 .map(Self::ONBOARD_COMPUTER_STATUS)
33438 }
33439 OPEN_DRONE_ID_ARM_STATUS_DATA::ID => {
33440 OPEN_DRONE_ID_ARM_STATUS_DATA::deser(version, payload)
33441 .map(Self::OPEN_DRONE_ID_ARM_STATUS)
33442 }
33443 OPEN_DRONE_ID_AUTHENTICATION_DATA::ID => {
33444 OPEN_DRONE_ID_AUTHENTICATION_DATA::deser(version, payload)
33445 .map(Self::OPEN_DRONE_ID_AUTHENTICATION)
33446 }
33447 OPEN_DRONE_ID_BASIC_ID_DATA::ID => OPEN_DRONE_ID_BASIC_ID_DATA::deser(version, payload)
33448 .map(Self::OPEN_DRONE_ID_BASIC_ID),
33449 OPEN_DRONE_ID_LOCATION_DATA::ID => OPEN_DRONE_ID_LOCATION_DATA::deser(version, payload)
33450 .map(Self::OPEN_DRONE_ID_LOCATION),
33451 OPEN_DRONE_ID_MESSAGE_PACK_DATA::ID => {
33452 OPEN_DRONE_ID_MESSAGE_PACK_DATA::deser(version, payload)
33453 .map(Self::OPEN_DRONE_ID_MESSAGE_PACK)
33454 }
33455 OPEN_DRONE_ID_OPERATOR_ID_DATA::ID => {
33456 OPEN_DRONE_ID_OPERATOR_ID_DATA::deser(version, payload)
33457 .map(Self::OPEN_DRONE_ID_OPERATOR_ID)
33458 }
33459 OPEN_DRONE_ID_SELF_ID_DATA::ID => {
33460 OPEN_DRONE_ID_SELF_ID_DATA::deser(version, payload).map(Self::OPEN_DRONE_ID_SELF_ID)
33461 }
33462 OPEN_DRONE_ID_SYSTEM_DATA::ID => {
33463 OPEN_DRONE_ID_SYSTEM_DATA::deser(version, payload).map(Self::OPEN_DRONE_ID_SYSTEM)
33464 }
33465 OPEN_DRONE_ID_SYSTEM_UPDATE_DATA::ID => {
33466 OPEN_DRONE_ID_SYSTEM_UPDATE_DATA::deser(version, payload)
33467 .map(Self::OPEN_DRONE_ID_SYSTEM_UPDATE)
33468 }
33469 OPTICAL_FLOW_DATA::ID => {
33470 OPTICAL_FLOW_DATA::deser(version, payload).map(Self::OPTICAL_FLOW)
33471 }
33472 OPTICAL_FLOW_RAD_DATA::ID => {
33473 OPTICAL_FLOW_RAD_DATA::deser(version, payload).map(Self::OPTICAL_FLOW_RAD)
33474 }
33475 ORBIT_EXECUTION_STATUS_DATA::ID => ORBIT_EXECUTION_STATUS_DATA::deser(version, payload)
33476 .map(Self::ORBIT_EXECUTION_STATUS),
33477 PARAM_EXT_ACK_DATA::ID => {
33478 PARAM_EXT_ACK_DATA::deser(version, payload).map(Self::PARAM_EXT_ACK)
33479 }
33480 PARAM_EXT_REQUEST_LIST_DATA::ID => PARAM_EXT_REQUEST_LIST_DATA::deser(version, payload)
33481 .map(Self::PARAM_EXT_REQUEST_LIST),
33482 PARAM_EXT_REQUEST_READ_DATA::ID => PARAM_EXT_REQUEST_READ_DATA::deser(version, payload)
33483 .map(Self::PARAM_EXT_REQUEST_READ),
33484 PARAM_EXT_SET_DATA::ID => {
33485 PARAM_EXT_SET_DATA::deser(version, payload).map(Self::PARAM_EXT_SET)
33486 }
33487 PARAM_EXT_VALUE_DATA::ID => {
33488 PARAM_EXT_VALUE_DATA::deser(version, payload).map(Self::PARAM_EXT_VALUE)
33489 }
33490 PARAM_MAP_RC_DATA::ID => {
33491 PARAM_MAP_RC_DATA::deser(version, payload).map(Self::PARAM_MAP_RC)
33492 }
33493 PARAM_REQUEST_LIST_DATA::ID => {
33494 PARAM_REQUEST_LIST_DATA::deser(version, payload).map(Self::PARAM_REQUEST_LIST)
33495 }
33496 PARAM_REQUEST_READ_DATA::ID => {
33497 PARAM_REQUEST_READ_DATA::deser(version, payload).map(Self::PARAM_REQUEST_READ)
33498 }
33499 PARAM_SET_DATA::ID => PARAM_SET_DATA::deser(version, payload).map(Self::PARAM_SET),
33500 PARAM_VALUE_DATA::ID => {
33501 PARAM_VALUE_DATA::deser(version, payload).map(Self::PARAM_VALUE)
33502 }
33503 PING_DATA::ID => PING_DATA::deser(version, payload).map(Self::PING),
33504 PLAY_TUNE_DATA::ID => PLAY_TUNE_DATA::deser(version, payload).map(Self::PLAY_TUNE),
33505 PLAY_TUNE_V2_DATA::ID => {
33506 PLAY_TUNE_V2_DATA::deser(version, payload).map(Self::PLAY_TUNE_V2)
33507 }
33508 POSITION_TARGET_GLOBAL_INT_DATA::ID => {
33509 POSITION_TARGET_GLOBAL_INT_DATA::deser(version, payload)
33510 .map(Self::POSITION_TARGET_GLOBAL_INT)
33511 }
33512 POSITION_TARGET_LOCAL_NED_DATA::ID => {
33513 POSITION_TARGET_LOCAL_NED_DATA::deser(version, payload)
33514 .map(Self::POSITION_TARGET_LOCAL_NED)
33515 }
33516 POWER_STATUS_DATA::ID => {
33517 POWER_STATUS_DATA::deser(version, payload).map(Self::POWER_STATUS)
33518 }
33519 PROTOCOL_VERSION_DATA::ID => {
33520 PROTOCOL_VERSION_DATA::deser(version, payload).map(Self::PROTOCOL_VERSION)
33521 }
33522 RADIO_STATUS_DATA::ID => {
33523 RADIO_STATUS_DATA::deser(version, payload).map(Self::RADIO_STATUS)
33524 }
33525 RAW_IMU_DATA::ID => RAW_IMU_DATA::deser(version, payload).map(Self::RAW_IMU),
33526 RAW_PRESSURE_DATA::ID => {
33527 RAW_PRESSURE_DATA::deser(version, payload).map(Self::RAW_PRESSURE)
33528 }
33529 RAW_RPM_DATA::ID => RAW_RPM_DATA::deser(version, payload).map(Self::RAW_RPM),
33530 RC_CHANNELS_DATA::ID => {
33531 RC_CHANNELS_DATA::deser(version, payload).map(Self::RC_CHANNELS)
33532 }
33533 RC_CHANNELS_OVERRIDE_DATA::ID => {
33534 RC_CHANNELS_OVERRIDE_DATA::deser(version, payload).map(Self::RC_CHANNELS_OVERRIDE)
33535 }
33536 RC_CHANNELS_RAW_DATA::ID => {
33537 RC_CHANNELS_RAW_DATA::deser(version, payload).map(Self::RC_CHANNELS_RAW)
33538 }
33539 RC_CHANNELS_SCALED_DATA::ID => {
33540 RC_CHANNELS_SCALED_DATA::deser(version, payload).map(Self::RC_CHANNELS_SCALED)
33541 }
33542 REQUEST_DATA_STREAM_DATA::ID => {
33543 REQUEST_DATA_STREAM_DATA::deser(version, payload).map(Self::REQUEST_DATA_STREAM)
33544 }
33545 REQUEST_EVENT_DATA::ID => {
33546 REQUEST_EVENT_DATA::deser(version, payload).map(Self::REQUEST_EVENT)
33547 }
33548 RESOURCE_REQUEST_DATA::ID => {
33549 RESOURCE_REQUEST_DATA::deser(version, payload).map(Self::RESOURCE_REQUEST)
33550 }
33551 RESPONSE_EVENT_ERROR_DATA::ID => {
33552 RESPONSE_EVENT_ERROR_DATA::deser(version, payload).map(Self::RESPONSE_EVENT_ERROR)
33553 }
33554 SAFETY_ALLOWED_AREA_DATA::ID => {
33555 SAFETY_ALLOWED_AREA_DATA::deser(version, payload).map(Self::SAFETY_ALLOWED_AREA)
33556 }
33557 SAFETY_SET_ALLOWED_AREA_DATA::ID => {
33558 SAFETY_SET_ALLOWED_AREA_DATA::deser(version, payload)
33559 .map(Self::SAFETY_SET_ALLOWED_AREA)
33560 }
33561 SCALED_IMU_DATA::ID => SCALED_IMU_DATA::deser(version, payload).map(Self::SCALED_IMU),
33562 SCALED_IMU2_DATA::ID => {
33563 SCALED_IMU2_DATA::deser(version, payload).map(Self::SCALED_IMU2)
33564 }
33565 SCALED_IMU3_DATA::ID => {
33566 SCALED_IMU3_DATA::deser(version, payload).map(Self::SCALED_IMU3)
33567 }
33568 SCALED_PRESSURE_DATA::ID => {
33569 SCALED_PRESSURE_DATA::deser(version, payload).map(Self::SCALED_PRESSURE)
33570 }
33571 SCALED_PRESSURE2_DATA::ID => {
33572 SCALED_PRESSURE2_DATA::deser(version, payload).map(Self::SCALED_PRESSURE2)
33573 }
33574 SCALED_PRESSURE3_DATA::ID => {
33575 SCALED_PRESSURE3_DATA::deser(version, payload).map(Self::SCALED_PRESSURE3)
33576 }
33577 SERIAL_CONTROL_DATA::ID => {
33578 SERIAL_CONTROL_DATA::deser(version, payload).map(Self::SERIAL_CONTROL)
33579 }
33580 SERVO_OUTPUT_RAW_DATA::ID => {
33581 SERVO_OUTPUT_RAW_DATA::deser(version, payload).map(Self::SERVO_OUTPUT_RAW)
33582 }
33583 SETUP_SIGNING_DATA::ID => {
33584 SETUP_SIGNING_DATA::deser(version, payload).map(Self::SETUP_SIGNING)
33585 }
33586 SET_ACTUATOR_CONTROL_TARGET_DATA::ID => {
33587 SET_ACTUATOR_CONTROL_TARGET_DATA::deser(version, payload)
33588 .map(Self::SET_ACTUATOR_CONTROL_TARGET)
33589 }
33590 SET_ATTITUDE_TARGET_DATA::ID => {
33591 SET_ATTITUDE_TARGET_DATA::deser(version, payload).map(Self::SET_ATTITUDE_TARGET)
33592 }
33593 SET_GPS_GLOBAL_ORIGIN_DATA::ID => {
33594 SET_GPS_GLOBAL_ORIGIN_DATA::deser(version, payload).map(Self::SET_GPS_GLOBAL_ORIGIN)
33595 }
33596 SET_HOME_POSITION_DATA::ID => {
33597 SET_HOME_POSITION_DATA::deser(version, payload).map(Self::SET_HOME_POSITION)
33598 }
33599 SET_MODE_DATA::ID => SET_MODE_DATA::deser(version, payload).map(Self::SET_MODE),
33600 SET_POSITION_TARGET_GLOBAL_INT_DATA::ID => {
33601 SET_POSITION_TARGET_GLOBAL_INT_DATA::deser(version, payload)
33602 .map(Self::SET_POSITION_TARGET_GLOBAL_INT)
33603 }
33604 SET_POSITION_TARGET_LOCAL_NED_DATA::ID => {
33605 SET_POSITION_TARGET_LOCAL_NED_DATA::deser(version, payload)
33606 .map(Self::SET_POSITION_TARGET_LOCAL_NED)
33607 }
33608 SIM_STATE_DATA::ID => SIM_STATE_DATA::deser(version, payload).map(Self::SIM_STATE),
33609 SMART_BATTERY_INFO_DATA::ID => {
33610 SMART_BATTERY_INFO_DATA::deser(version, payload).map(Self::SMART_BATTERY_INFO)
33611 }
33612 STATUSTEXT_DATA::ID => STATUSTEXT_DATA::deser(version, payload).map(Self::STATUSTEXT),
33613 STORAGE_INFORMATION_DATA::ID => {
33614 STORAGE_INFORMATION_DATA::deser(version, payload).map(Self::STORAGE_INFORMATION)
33615 }
33616 SUPPORTED_TUNES_DATA::ID => {
33617 SUPPORTED_TUNES_DATA::deser(version, payload).map(Self::SUPPORTED_TUNES)
33618 }
33619 SYSTEM_TIME_DATA::ID => {
33620 SYSTEM_TIME_DATA::deser(version, payload).map(Self::SYSTEM_TIME)
33621 }
33622 SYS_STATUS_DATA::ID => SYS_STATUS_DATA::deser(version, payload).map(Self::SYS_STATUS),
33623 TERRAIN_CHECK_DATA::ID => {
33624 TERRAIN_CHECK_DATA::deser(version, payload).map(Self::TERRAIN_CHECK)
33625 }
33626 TERRAIN_DATA_DATA::ID => {
33627 TERRAIN_DATA_DATA::deser(version, payload).map(Self::TERRAIN_DATA)
33628 }
33629 TERRAIN_REPORT_DATA::ID => {
33630 TERRAIN_REPORT_DATA::deser(version, payload).map(Self::TERRAIN_REPORT)
33631 }
33632 TERRAIN_REQUEST_DATA::ID => {
33633 TERRAIN_REQUEST_DATA::deser(version, payload).map(Self::TERRAIN_REQUEST)
33634 }
33635 TIMESYNC_DATA::ID => TIMESYNC_DATA::deser(version, payload).map(Self::TIMESYNC),
33636 TIME_ESTIMATE_TO_TARGET_DATA::ID => {
33637 TIME_ESTIMATE_TO_TARGET_DATA::deser(version, payload)
33638 .map(Self::TIME_ESTIMATE_TO_TARGET)
33639 }
33640 TRAJECTORY_REPRESENTATION_BEZIER_DATA::ID => {
33641 TRAJECTORY_REPRESENTATION_BEZIER_DATA::deser(version, payload)
33642 .map(Self::TRAJECTORY_REPRESENTATION_BEZIER)
33643 }
33644 TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA::ID => {
33645 TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA::deser(version, payload)
33646 .map(Self::TRAJECTORY_REPRESENTATION_WAYPOINTS)
33647 }
33648 TUNNEL_DATA::ID => TUNNEL_DATA::deser(version, payload).map(Self::TUNNEL),
33649 UAVCAN_NODE_INFO_DATA::ID => {
33650 UAVCAN_NODE_INFO_DATA::deser(version, payload).map(Self::UAVCAN_NODE_INFO)
33651 }
33652 UAVCAN_NODE_STATUS_DATA::ID => {
33653 UAVCAN_NODE_STATUS_DATA::deser(version, payload).map(Self::UAVCAN_NODE_STATUS)
33654 }
33655 UTM_GLOBAL_POSITION_DATA::ID => {
33656 UTM_GLOBAL_POSITION_DATA::deser(version, payload).map(Self::UTM_GLOBAL_POSITION)
33657 }
33658 V2_EXTENSION_DATA::ID => {
33659 V2_EXTENSION_DATA::deser(version, payload).map(Self::V2_EXTENSION)
33660 }
33661 VFR_HUD_DATA::ID => VFR_HUD_DATA::deser(version, payload).map(Self::VFR_HUD),
33662 VIBRATION_DATA::ID => VIBRATION_DATA::deser(version, payload).map(Self::VIBRATION),
33663 VICON_POSITION_ESTIMATE_DATA::ID => {
33664 VICON_POSITION_ESTIMATE_DATA::deser(version, payload)
33665 .map(Self::VICON_POSITION_ESTIMATE)
33666 }
33667 VIDEO_STREAM_INFORMATION_DATA::ID => {
33668 VIDEO_STREAM_INFORMATION_DATA::deser(version, payload)
33669 .map(Self::VIDEO_STREAM_INFORMATION)
33670 }
33671 VIDEO_STREAM_STATUS_DATA::ID => {
33672 VIDEO_STREAM_STATUS_DATA::deser(version, payload).map(Self::VIDEO_STREAM_STATUS)
33673 }
33674 VISION_POSITION_ESTIMATE_DATA::ID => {
33675 VISION_POSITION_ESTIMATE_DATA::deser(version, payload)
33676 .map(Self::VISION_POSITION_ESTIMATE)
33677 }
33678 VISION_SPEED_ESTIMATE_DATA::ID => {
33679 VISION_SPEED_ESTIMATE_DATA::deser(version, payload).map(Self::VISION_SPEED_ESTIMATE)
33680 }
33681 WHEEL_DISTANCE_DATA::ID => {
33682 WHEEL_DISTANCE_DATA::deser(version, payload).map(Self::WHEEL_DISTANCE)
33683 }
33684 WIFI_CONFIG_AP_DATA::ID => {
33685 WIFI_CONFIG_AP_DATA::deser(version, payload).map(Self::WIFI_CONFIG_AP)
33686 }
33687 WINCH_STATUS_DATA::ID => {
33688 WINCH_STATUS_DATA::deser(version, payload).map(Self::WINCH_STATUS)
33689 }
33690 WIND_COV_DATA::ID => WIND_COV_DATA::deser(version, payload).map(Self::WIND_COV),
33691 _ => Err(::mavlink_core::error::ParserError::UnknownMessage { id }),
33692 }
33693 }
33694 fn message_name(&self) -> &'static str {
33695 match self {
33696 Self::ACTUATOR_CONTROL_TARGET(..) => ACTUATOR_CONTROL_TARGET_DATA::NAME,
33697 Self::ACTUATOR_OUTPUT_STATUS(..) => ACTUATOR_OUTPUT_STATUS_DATA::NAME,
33698 Self::ADSB_VEHICLE(..) => ADSB_VEHICLE_DATA::NAME,
33699 Self::AIS_VESSEL(..) => AIS_VESSEL_DATA::NAME,
33700 Self::ALTITUDE(..) => ALTITUDE_DATA::NAME,
33701 Self::ATTITUDE(..) => ATTITUDE_DATA::NAME,
33702 Self::ATTITUDE_QUATERNION(..) => ATTITUDE_QUATERNION_DATA::NAME,
33703 Self::ATTITUDE_QUATERNION_COV(..) => ATTITUDE_QUATERNION_COV_DATA::NAME,
33704 Self::ATTITUDE_TARGET(..) => ATTITUDE_TARGET_DATA::NAME,
33705 Self::ATT_POS_MOCAP(..) => ATT_POS_MOCAP_DATA::NAME,
33706 Self::AUTH_KEY(..) => AUTH_KEY_DATA::NAME,
33707 Self::AUTOPILOT_STATE_FOR_GIMBAL_DEVICE(..) => {
33708 AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA::NAME
33709 }
33710 Self::AUTOPILOT_VERSION(..) => AUTOPILOT_VERSION_DATA::NAME,
33711 Self::AVAILABLE_MODES(..) => AVAILABLE_MODES_DATA::NAME,
33712 Self::AVAILABLE_MODES_MONITOR(..) => AVAILABLE_MODES_MONITOR_DATA::NAME,
33713 Self::BATTERY_INFO(..) => BATTERY_INFO_DATA::NAME,
33714 Self::BATTERY_STATUS(..) => BATTERY_STATUS_DATA::NAME,
33715 Self::BUTTON_CHANGE(..) => BUTTON_CHANGE_DATA::NAME,
33716 Self::CAMERA_CAPTURE_STATUS(..) => CAMERA_CAPTURE_STATUS_DATA::NAME,
33717 Self::CAMERA_FOV_STATUS(..) => CAMERA_FOV_STATUS_DATA::NAME,
33718 Self::CAMERA_IMAGE_CAPTURED(..) => CAMERA_IMAGE_CAPTURED_DATA::NAME,
33719 Self::CAMERA_INFORMATION(..) => CAMERA_INFORMATION_DATA::NAME,
33720 Self::CAMERA_SETTINGS(..) => CAMERA_SETTINGS_DATA::NAME,
33721 Self::CAMERA_THERMAL_RANGE(..) => CAMERA_THERMAL_RANGE_DATA::NAME,
33722 Self::CAMERA_TRACKING_GEO_STATUS(..) => CAMERA_TRACKING_GEO_STATUS_DATA::NAME,
33723 Self::CAMERA_TRACKING_IMAGE_STATUS(..) => CAMERA_TRACKING_IMAGE_STATUS_DATA::NAME,
33724 Self::CAMERA_TRIGGER(..) => CAMERA_TRIGGER_DATA::NAME,
33725 Self::CANFD_FRAME(..) => CANFD_FRAME_DATA::NAME,
33726 Self::CAN_FILTER_MODIFY(..) => CAN_FILTER_MODIFY_DATA::NAME,
33727 Self::CAN_FRAME(..) => CAN_FRAME_DATA::NAME,
33728 Self::CELLULAR_CONFIG(..) => CELLULAR_CONFIG_DATA::NAME,
33729 Self::CELLULAR_STATUS(..) => CELLULAR_STATUS_DATA::NAME,
33730 Self::CHANGE_OPERATOR_CONTROL(..) => CHANGE_OPERATOR_CONTROL_DATA::NAME,
33731 Self::CHANGE_OPERATOR_CONTROL_ACK(..) => CHANGE_OPERATOR_CONTROL_ACK_DATA::NAME,
33732 Self::COLLISION(..) => COLLISION_DATA::NAME,
33733 Self::COMMAND_ACK(..) => COMMAND_ACK_DATA::NAME,
33734 Self::COMMAND_CANCEL(..) => COMMAND_CANCEL_DATA::NAME,
33735 Self::COMMAND_INT(..) => COMMAND_INT_DATA::NAME,
33736 Self::COMMAND_LONG(..) => COMMAND_LONG_DATA::NAME,
33737 Self::COMPONENT_INFORMATION(..) => COMPONENT_INFORMATION_DATA::NAME,
33738 Self::COMPONENT_INFORMATION_BASIC(..) => COMPONENT_INFORMATION_BASIC_DATA::NAME,
33739 Self::COMPONENT_METADATA(..) => COMPONENT_METADATA_DATA::NAME,
33740 Self::CONTROL_SYSTEM_STATE(..) => CONTROL_SYSTEM_STATE_DATA::NAME,
33741 Self::CURRENT_EVENT_SEQUENCE(..) => CURRENT_EVENT_SEQUENCE_DATA::NAME,
33742 Self::CURRENT_MODE(..) => CURRENT_MODE_DATA::NAME,
33743 Self::DATA_STREAM(..) => DATA_STREAM_DATA::NAME,
33744 Self::DATA_TRANSMISSION_HANDSHAKE(..) => DATA_TRANSMISSION_HANDSHAKE_DATA::NAME,
33745 Self::DEBUG(..) => DEBUG_DATA::NAME,
33746 Self::DEBUG_FLOAT_ARRAY(..) => DEBUG_FLOAT_ARRAY_DATA::NAME,
33747 Self::DEBUG_VECT(..) => DEBUG_VECT_DATA::NAME,
33748 Self::DISTANCE_SENSOR(..) => DISTANCE_SENSOR_DATA::NAME,
33749 Self::EFI_STATUS(..) => EFI_STATUS_DATA::NAME,
33750 Self::ENCAPSULATED_DATA(..) => ENCAPSULATED_DATA_DATA::NAME,
33751 Self::ESC_INFO(..) => ESC_INFO_DATA::NAME,
33752 Self::ESC_STATUS(..) => ESC_STATUS_DATA::NAME,
33753 Self::ESTIMATOR_STATUS(..) => ESTIMATOR_STATUS_DATA::NAME,
33754 Self::EVENT(..) => EVENT_DATA::NAME,
33755 Self::EXTENDED_SYS_STATE(..) => EXTENDED_SYS_STATE_DATA::NAME,
33756 Self::FENCE_STATUS(..) => FENCE_STATUS_DATA::NAME,
33757 Self::FILE_TRANSFER_PROTOCOL(..) => FILE_TRANSFER_PROTOCOL_DATA::NAME,
33758 Self::FLIGHT_INFORMATION(..) => FLIGHT_INFORMATION_DATA::NAME,
33759 Self::FOLLOW_TARGET(..) => FOLLOW_TARGET_DATA::NAME,
33760 Self::FUEL_STATUS(..) => FUEL_STATUS_DATA::NAME,
33761 Self::GENERATOR_STATUS(..) => GENERATOR_STATUS_DATA::NAME,
33762 Self::GIMBAL_DEVICE_ATTITUDE_STATUS(..) => GIMBAL_DEVICE_ATTITUDE_STATUS_DATA::NAME,
33763 Self::GIMBAL_DEVICE_INFORMATION(..) => GIMBAL_DEVICE_INFORMATION_DATA::NAME,
33764 Self::GIMBAL_DEVICE_SET_ATTITUDE(..) => GIMBAL_DEVICE_SET_ATTITUDE_DATA::NAME,
33765 Self::GIMBAL_MANAGER_INFORMATION(..) => GIMBAL_MANAGER_INFORMATION_DATA::NAME,
33766 Self::GIMBAL_MANAGER_SET_ATTITUDE(..) => GIMBAL_MANAGER_SET_ATTITUDE_DATA::NAME,
33767 Self::GIMBAL_MANAGER_SET_MANUAL_CONTROL(..) => {
33768 GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA::NAME
33769 }
33770 Self::GIMBAL_MANAGER_SET_PITCHYAW(..) => GIMBAL_MANAGER_SET_PITCHYAW_DATA::NAME,
33771 Self::GIMBAL_MANAGER_STATUS(..) => GIMBAL_MANAGER_STATUS_DATA::NAME,
33772 Self::GLOBAL_POSITION_INT(..) => GLOBAL_POSITION_INT_DATA::NAME,
33773 Self::GLOBAL_POSITION_INT_COV(..) => GLOBAL_POSITION_INT_COV_DATA::NAME,
33774 Self::GLOBAL_VISION_POSITION_ESTIMATE(..) => GLOBAL_VISION_POSITION_ESTIMATE_DATA::NAME,
33775 Self::GPS2_RAW(..) => GPS2_RAW_DATA::NAME,
33776 Self::GPS2_RTK(..) => GPS2_RTK_DATA::NAME,
33777 Self::GPS_GLOBAL_ORIGIN(..) => GPS_GLOBAL_ORIGIN_DATA::NAME,
33778 Self::GPS_INJECT_DATA(..) => GPS_INJECT_DATA_DATA::NAME,
33779 Self::GPS_INPUT(..) => GPS_INPUT_DATA::NAME,
33780 Self::GPS_RAW_INT(..) => GPS_RAW_INT_DATA::NAME,
33781 Self::GPS_RTCM_DATA(..) => GPS_RTCM_DATA_DATA::NAME,
33782 Self::GPS_RTK(..) => GPS_RTK_DATA::NAME,
33783 Self::GPS_STATUS(..) => GPS_STATUS_DATA::NAME,
33784 Self::HEARTBEAT(..) => HEARTBEAT_DATA::NAME,
33785 Self::HIGHRES_IMU(..) => HIGHRES_IMU_DATA::NAME,
33786 Self::HIGH_LATENCY(..) => HIGH_LATENCY_DATA::NAME,
33787 Self::HIGH_LATENCY2(..) => HIGH_LATENCY2_DATA::NAME,
33788 Self::HIL_ACTUATOR_CONTROLS(..) => HIL_ACTUATOR_CONTROLS_DATA::NAME,
33789 Self::HIL_CONTROLS(..) => HIL_CONTROLS_DATA::NAME,
33790 Self::HIL_GPS(..) => HIL_GPS_DATA::NAME,
33791 Self::HIL_OPTICAL_FLOW(..) => HIL_OPTICAL_FLOW_DATA::NAME,
33792 Self::HIL_RC_INPUTS_RAW(..) => HIL_RC_INPUTS_RAW_DATA::NAME,
33793 Self::HIL_SENSOR(..) => HIL_SENSOR_DATA::NAME,
33794 Self::HIL_STATE(..) => HIL_STATE_DATA::NAME,
33795 Self::HIL_STATE_QUATERNION(..) => HIL_STATE_QUATERNION_DATA::NAME,
33796 Self::HOME_POSITION(..) => HOME_POSITION_DATA::NAME,
33797 Self::HYGROMETER_SENSOR(..) => HYGROMETER_SENSOR_DATA::NAME,
33798 Self::ILLUMINATOR_STATUS(..) => ILLUMINATOR_STATUS_DATA::NAME,
33799 Self::ISBD_LINK_STATUS(..) => ISBD_LINK_STATUS_DATA::NAME,
33800 Self::LANDING_TARGET(..) => LANDING_TARGET_DATA::NAME,
33801 Self::LINK_NODE_STATUS(..) => LINK_NODE_STATUS_DATA::NAME,
33802 Self::LOCAL_POSITION_NED(..) => LOCAL_POSITION_NED_DATA::NAME,
33803 Self::LOCAL_POSITION_NED_COV(..) => LOCAL_POSITION_NED_COV_DATA::NAME,
33804 Self::LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET(..) => {
33805 LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA::NAME
33806 }
33807 Self::LOGGING_ACK(..) => LOGGING_ACK_DATA::NAME,
33808 Self::LOGGING_DATA(..) => LOGGING_DATA_DATA::NAME,
33809 Self::LOGGING_DATA_ACKED(..) => LOGGING_DATA_ACKED_DATA::NAME,
33810 Self::LOG_DATA(..) => LOG_DATA_DATA::NAME,
33811 Self::LOG_ENTRY(..) => LOG_ENTRY_DATA::NAME,
33812 Self::LOG_ERASE(..) => LOG_ERASE_DATA::NAME,
33813 Self::LOG_REQUEST_DATA(..) => LOG_REQUEST_DATA_DATA::NAME,
33814 Self::LOG_REQUEST_END(..) => LOG_REQUEST_END_DATA::NAME,
33815 Self::LOG_REQUEST_LIST(..) => LOG_REQUEST_LIST_DATA::NAME,
33816 Self::MAG_CAL_REPORT(..) => MAG_CAL_REPORT_DATA::NAME,
33817 Self::MANUAL_CONTROL(..) => MANUAL_CONTROL_DATA::NAME,
33818 Self::MANUAL_SETPOINT(..) => MANUAL_SETPOINT_DATA::NAME,
33819 Self::MEMORY_VECT(..) => MEMORY_VECT_DATA::NAME,
33820 Self::MESSAGE_INTERVAL(..) => MESSAGE_INTERVAL_DATA::NAME,
33821 Self::MISSION_ACK(..) => MISSION_ACK_DATA::NAME,
33822 Self::MISSION_CLEAR_ALL(..) => MISSION_CLEAR_ALL_DATA::NAME,
33823 Self::MISSION_COUNT(..) => MISSION_COUNT_DATA::NAME,
33824 Self::MISSION_CURRENT(..) => MISSION_CURRENT_DATA::NAME,
33825 Self::MISSION_ITEM(..) => MISSION_ITEM_DATA::NAME,
33826 Self::MISSION_ITEM_INT(..) => MISSION_ITEM_INT_DATA::NAME,
33827 Self::MISSION_ITEM_REACHED(..) => MISSION_ITEM_REACHED_DATA::NAME,
33828 Self::MISSION_REQUEST(..) => MISSION_REQUEST_DATA::NAME,
33829 Self::MISSION_REQUEST_INT(..) => MISSION_REQUEST_INT_DATA::NAME,
33830 Self::MISSION_REQUEST_LIST(..) => MISSION_REQUEST_LIST_DATA::NAME,
33831 Self::MISSION_REQUEST_PARTIAL_LIST(..) => MISSION_REQUEST_PARTIAL_LIST_DATA::NAME,
33832 Self::MISSION_SET_CURRENT(..) => MISSION_SET_CURRENT_DATA::NAME,
33833 Self::MISSION_WRITE_PARTIAL_LIST(..) => MISSION_WRITE_PARTIAL_LIST_DATA::NAME,
33834 Self::MOUNT_ORIENTATION(..) => MOUNT_ORIENTATION_DATA::NAME,
33835 Self::NAMED_VALUE_FLOAT(..) => NAMED_VALUE_FLOAT_DATA::NAME,
33836 Self::NAMED_VALUE_INT(..) => NAMED_VALUE_INT_DATA::NAME,
33837 Self::NAV_CONTROLLER_OUTPUT(..) => NAV_CONTROLLER_OUTPUT_DATA::NAME,
33838 Self::OBSTACLE_DISTANCE(..) => OBSTACLE_DISTANCE_DATA::NAME,
33839 Self::ODOMETRY(..) => ODOMETRY_DATA::NAME,
33840 Self::ONBOARD_COMPUTER_STATUS(..) => ONBOARD_COMPUTER_STATUS_DATA::NAME,
33841 Self::OPEN_DRONE_ID_ARM_STATUS(..) => OPEN_DRONE_ID_ARM_STATUS_DATA::NAME,
33842 Self::OPEN_DRONE_ID_AUTHENTICATION(..) => OPEN_DRONE_ID_AUTHENTICATION_DATA::NAME,
33843 Self::OPEN_DRONE_ID_BASIC_ID(..) => OPEN_DRONE_ID_BASIC_ID_DATA::NAME,
33844 Self::OPEN_DRONE_ID_LOCATION(..) => OPEN_DRONE_ID_LOCATION_DATA::NAME,
33845 Self::OPEN_DRONE_ID_MESSAGE_PACK(..) => OPEN_DRONE_ID_MESSAGE_PACK_DATA::NAME,
33846 Self::OPEN_DRONE_ID_OPERATOR_ID(..) => OPEN_DRONE_ID_OPERATOR_ID_DATA::NAME,
33847 Self::OPEN_DRONE_ID_SELF_ID(..) => OPEN_DRONE_ID_SELF_ID_DATA::NAME,
33848 Self::OPEN_DRONE_ID_SYSTEM(..) => OPEN_DRONE_ID_SYSTEM_DATA::NAME,
33849 Self::OPEN_DRONE_ID_SYSTEM_UPDATE(..) => OPEN_DRONE_ID_SYSTEM_UPDATE_DATA::NAME,
33850 Self::OPTICAL_FLOW(..) => OPTICAL_FLOW_DATA::NAME,
33851 Self::OPTICAL_FLOW_RAD(..) => OPTICAL_FLOW_RAD_DATA::NAME,
33852 Self::ORBIT_EXECUTION_STATUS(..) => ORBIT_EXECUTION_STATUS_DATA::NAME,
33853 Self::PARAM_EXT_ACK(..) => PARAM_EXT_ACK_DATA::NAME,
33854 Self::PARAM_EXT_REQUEST_LIST(..) => PARAM_EXT_REQUEST_LIST_DATA::NAME,
33855 Self::PARAM_EXT_REQUEST_READ(..) => PARAM_EXT_REQUEST_READ_DATA::NAME,
33856 Self::PARAM_EXT_SET(..) => PARAM_EXT_SET_DATA::NAME,
33857 Self::PARAM_EXT_VALUE(..) => PARAM_EXT_VALUE_DATA::NAME,
33858 Self::PARAM_MAP_RC(..) => PARAM_MAP_RC_DATA::NAME,
33859 Self::PARAM_REQUEST_LIST(..) => PARAM_REQUEST_LIST_DATA::NAME,
33860 Self::PARAM_REQUEST_READ(..) => PARAM_REQUEST_READ_DATA::NAME,
33861 Self::PARAM_SET(..) => PARAM_SET_DATA::NAME,
33862 Self::PARAM_VALUE(..) => PARAM_VALUE_DATA::NAME,
33863 Self::PING(..) => PING_DATA::NAME,
33864 Self::PLAY_TUNE(..) => PLAY_TUNE_DATA::NAME,
33865 Self::PLAY_TUNE_V2(..) => PLAY_TUNE_V2_DATA::NAME,
33866 Self::POSITION_TARGET_GLOBAL_INT(..) => POSITION_TARGET_GLOBAL_INT_DATA::NAME,
33867 Self::POSITION_TARGET_LOCAL_NED(..) => POSITION_TARGET_LOCAL_NED_DATA::NAME,
33868 Self::POWER_STATUS(..) => POWER_STATUS_DATA::NAME,
33869 Self::PROTOCOL_VERSION(..) => PROTOCOL_VERSION_DATA::NAME,
33870 Self::RADIO_STATUS(..) => RADIO_STATUS_DATA::NAME,
33871 Self::RAW_IMU(..) => RAW_IMU_DATA::NAME,
33872 Self::RAW_PRESSURE(..) => RAW_PRESSURE_DATA::NAME,
33873 Self::RAW_RPM(..) => RAW_RPM_DATA::NAME,
33874 Self::RC_CHANNELS(..) => RC_CHANNELS_DATA::NAME,
33875 Self::RC_CHANNELS_OVERRIDE(..) => RC_CHANNELS_OVERRIDE_DATA::NAME,
33876 Self::RC_CHANNELS_RAW(..) => RC_CHANNELS_RAW_DATA::NAME,
33877 Self::RC_CHANNELS_SCALED(..) => RC_CHANNELS_SCALED_DATA::NAME,
33878 Self::REQUEST_DATA_STREAM(..) => REQUEST_DATA_STREAM_DATA::NAME,
33879 Self::REQUEST_EVENT(..) => REQUEST_EVENT_DATA::NAME,
33880 Self::RESOURCE_REQUEST(..) => RESOURCE_REQUEST_DATA::NAME,
33881 Self::RESPONSE_EVENT_ERROR(..) => RESPONSE_EVENT_ERROR_DATA::NAME,
33882 Self::SAFETY_ALLOWED_AREA(..) => SAFETY_ALLOWED_AREA_DATA::NAME,
33883 Self::SAFETY_SET_ALLOWED_AREA(..) => SAFETY_SET_ALLOWED_AREA_DATA::NAME,
33884 Self::SCALED_IMU(..) => SCALED_IMU_DATA::NAME,
33885 Self::SCALED_IMU2(..) => SCALED_IMU2_DATA::NAME,
33886 Self::SCALED_IMU3(..) => SCALED_IMU3_DATA::NAME,
33887 Self::SCALED_PRESSURE(..) => SCALED_PRESSURE_DATA::NAME,
33888 Self::SCALED_PRESSURE2(..) => SCALED_PRESSURE2_DATA::NAME,
33889 Self::SCALED_PRESSURE3(..) => SCALED_PRESSURE3_DATA::NAME,
33890 Self::SERIAL_CONTROL(..) => SERIAL_CONTROL_DATA::NAME,
33891 Self::SERVO_OUTPUT_RAW(..) => SERVO_OUTPUT_RAW_DATA::NAME,
33892 Self::SETUP_SIGNING(..) => SETUP_SIGNING_DATA::NAME,
33893 Self::SET_ACTUATOR_CONTROL_TARGET(..) => SET_ACTUATOR_CONTROL_TARGET_DATA::NAME,
33894 Self::SET_ATTITUDE_TARGET(..) => SET_ATTITUDE_TARGET_DATA::NAME,
33895 Self::SET_GPS_GLOBAL_ORIGIN(..) => SET_GPS_GLOBAL_ORIGIN_DATA::NAME,
33896 Self::SET_HOME_POSITION(..) => SET_HOME_POSITION_DATA::NAME,
33897 Self::SET_MODE(..) => SET_MODE_DATA::NAME,
33898 Self::SET_POSITION_TARGET_GLOBAL_INT(..) => SET_POSITION_TARGET_GLOBAL_INT_DATA::NAME,
33899 Self::SET_POSITION_TARGET_LOCAL_NED(..) => SET_POSITION_TARGET_LOCAL_NED_DATA::NAME,
33900 Self::SIM_STATE(..) => SIM_STATE_DATA::NAME,
33901 Self::SMART_BATTERY_INFO(..) => SMART_BATTERY_INFO_DATA::NAME,
33902 Self::STATUSTEXT(..) => STATUSTEXT_DATA::NAME,
33903 Self::STORAGE_INFORMATION(..) => STORAGE_INFORMATION_DATA::NAME,
33904 Self::SUPPORTED_TUNES(..) => SUPPORTED_TUNES_DATA::NAME,
33905 Self::SYSTEM_TIME(..) => SYSTEM_TIME_DATA::NAME,
33906 Self::SYS_STATUS(..) => SYS_STATUS_DATA::NAME,
33907 Self::TERRAIN_CHECK(..) => TERRAIN_CHECK_DATA::NAME,
33908 Self::TERRAIN_DATA(..) => TERRAIN_DATA_DATA::NAME,
33909 Self::TERRAIN_REPORT(..) => TERRAIN_REPORT_DATA::NAME,
33910 Self::TERRAIN_REQUEST(..) => TERRAIN_REQUEST_DATA::NAME,
33911 Self::TIMESYNC(..) => TIMESYNC_DATA::NAME,
33912 Self::TIME_ESTIMATE_TO_TARGET(..) => TIME_ESTIMATE_TO_TARGET_DATA::NAME,
33913 Self::TRAJECTORY_REPRESENTATION_BEZIER(..) => {
33914 TRAJECTORY_REPRESENTATION_BEZIER_DATA::NAME
33915 }
33916 Self::TRAJECTORY_REPRESENTATION_WAYPOINTS(..) => {
33917 TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA::NAME
33918 }
33919 Self::TUNNEL(..) => TUNNEL_DATA::NAME,
33920 Self::UAVCAN_NODE_INFO(..) => UAVCAN_NODE_INFO_DATA::NAME,
33921 Self::UAVCAN_NODE_STATUS(..) => UAVCAN_NODE_STATUS_DATA::NAME,
33922 Self::UTM_GLOBAL_POSITION(..) => UTM_GLOBAL_POSITION_DATA::NAME,
33923 Self::V2_EXTENSION(..) => V2_EXTENSION_DATA::NAME,
33924 Self::VFR_HUD(..) => VFR_HUD_DATA::NAME,
33925 Self::VIBRATION(..) => VIBRATION_DATA::NAME,
33926 Self::VICON_POSITION_ESTIMATE(..) => VICON_POSITION_ESTIMATE_DATA::NAME,
33927 Self::VIDEO_STREAM_INFORMATION(..) => VIDEO_STREAM_INFORMATION_DATA::NAME,
33928 Self::VIDEO_STREAM_STATUS(..) => VIDEO_STREAM_STATUS_DATA::NAME,
33929 Self::VISION_POSITION_ESTIMATE(..) => VISION_POSITION_ESTIMATE_DATA::NAME,
33930 Self::VISION_SPEED_ESTIMATE(..) => VISION_SPEED_ESTIMATE_DATA::NAME,
33931 Self::WHEEL_DISTANCE(..) => WHEEL_DISTANCE_DATA::NAME,
33932 Self::WIFI_CONFIG_AP(..) => WIFI_CONFIG_AP_DATA::NAME,
33933 Self::WINCH_STATUS(..) => WINCH_STATUS_DATA::NAME,
33934 Self::WIND_COV(..) => WIND_COV_DATA::NAME,
33935 }
33936 }
33937 fn message_id(&self) -> u32 {
33938 match self {
33939 Self::ACTUATOR_CONTROL_TARGET(..) => ACTUATOR_CONTROL_TARGET_DATA::ID,
33940 Self::ACTUATOR_OUTPUT_STATUS(..) => ACTUATOR_OUTPUT_STATUS_DATA::ID,
33941 Self::ADSB_VEHICLE(..) => ADSB_VEHICLE_DATA::ID,
33942 Self::AIS_VESSEL(..) => AIS_VESSEL_DATA::ID,
33943 Self::ALTITUDE(..) => ALTITUDE_DATA::ID,
33944 Self::ATTITUDE(..) => ATTITUDE_DATA::ID,
33945 Self::ATTITUDE_QUATERNION(..) => ATTITUDE_QUATERNION_DATA::ID,
33946 Self::ATTITUDE_QUATERNION_COV(..) => ATTITUDE_QUATERNION_COV_DATA::ID,
33947 Self::ATTITUDE_TARGET(..) => ATTITUDE_TARGET_DATA::ID,
33948 Self::ATT_POS_MOCAP(..) => ATT_POS_MOCAP_DATA::ID,
33949 Self::AUTH_KEY(..) => AUTH_KEY_DATA::ID,
33950 Self::AUTOPILOT_STATE_FOR_GIMBAL_DEVICE(..) => {
33951 AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA::ID
33952 }
33953 Self::AUTOPILOT_VERSION(..) => AUTOPILOT_VERSION_DATA::ID,
33954 Self::AVAILABLE_MODES(..) => AVAILABLE_MODES_DATA::ID,
33955 Self::AVAILABLE_MODES_MONITOR(..) => AVAILABLE_MODES_MONITOR_DATA::ID,
33956 Self::BATTERY_INFO(..) => BATTERY_INFO_DATA::ID,
33957 Self::BATTERY_STATUS(..) => BATTERY_STATUS_DATA::ID,
33958 Self::BUTTON_CHANGE(..) => BUTTON_CHANGE_DATA::ID,
33959 Self::CAMERA_CAPTURE_STATUS(..) => CAMERA_CAPTURE_STATUS_DATA::ID,
33960 Self::CAMERA_FOV_STATUS(..) => CAMERA_FOV_STATUS_DATA::ID,
33961 Self::CAMERA_IMAGE_CAPTURED(..) => CAMERA_IMAGE_CAPTURED_DATA::ID,
33962 Self::CAMERA_INFORMATION(..) => CAMERA_INFORMATION_DATA::ID,
33963 Self::CAMERA_SETTINGS(..) => CAMERA_SETTINGS_DATA::ID,
33964 Self::CAMERA_THERMAL_RANGE(..) => CAMERA_THERMAL_RANGE_DATA::ID,
33965 Self::CAMERA_TRACKING_GEO_STATUS(..) => CAMERA_TRACKING_GEO_STATUS_DATA::ID,
33966 Self::CAMERA_TRACKING_IMAGE_STATUS(..) => CAMERA_TRACKING_IMAGE_STATUS_DATA::ID,
33967 Self::CAMERA_TRIGGER(..) => CAMERA_TRIGGER_DATA::ID,
33968 Self::CANFD_FRAME(..) => CANFD_FRAME_DATA::ID,
33969 Self::CAN_FILTER_MODIFY(..) => CAN_FILTER_MODIFY_DATA::ID,
33970 Self::CAN_FRAME(..) => CAN_FRAME_DATA::ID,
33971 Self::CELLULAR_CONFIG(..) => CELLULAR_CONFIG_DATA::ID,
33972 Self::CELLULAR_STATUS(..) => CELLULAR_STATUS_DATA::ID,
33973 Self::CHANGE_OPERATOR_CONTROL(..) => CHANGE_OPERATOR_CONTROL_DATA::ID,
33974 Self::CHANGE_OPERATOR_CONTROL_ACK(..) => CHANGE_OPERATOR_CONTROL_ACK_DATA::ID,
33975 Self::COLLISION(..) => COLLISION_DATA::ID,
33976 Self::COMMAND_ACK(..) => COMMAND_ACK_DATA::ID,
33977 Self::COMMAND_CANCEL(..) => COMMAND_CANCEL_DATA::ID,
33978 Self::COMMAND_INT(..) => COMMAND_INT_DATA::ID,
33979 Self::COMMAND_LONG(..) => COMMAND_LONG_DATA::ID,
33980 Self::COMPONENT_INFORMATION(..) => COMPONENT_INFORMATION_DATA::ID,
33981 Self::COMPONENT_INFORMATION_BASIC(..) => COMPONENT_INFORMATION_BASIC_DATA::ID,
33982 Self::COMPONENT_METADATA(..) => COMPONENT_METADATA_DATA::ID,
33983 Self::CONTROL_SYSTEM_STATE(..) => CONTROL_SYSTEM_STATE_DATA::ID,
33984 Self::CURRENT_EVENT_SEQUENCE(..) => CURRENT_EVENT_SEQUENCE_DATA::ID,
33985 Self::CURRENT_MODE(..) => CURRENT_MODE_DATA::ID,
33986 Self::DATA_STREAM(..) => DATA_STREAM_DATA::ID,
33987 Self::DATA_TRANSMISSION_HANDSHAKE(..) => DATA_TRANSMISSION_HANDSHAKE_DATA::ID,
33988 Self::DEBUG(..) => DEBUG_DATA::ID,
33989 Self::DEBUG_FLOAT_ARRAY(..) => DEBUG_FLOAT_ARRAY_DATA::ID,
33990 Self::DEBUG_VECT(..) => DEBUG_VECT_DATA::ID,
33991 Self::DISTANCE_SENSOR(..) => DISTANCE_SENSOR_DATA::ID,
33992 Self::EFI_STATUS(..) => EFI_STATUS_DATA::ID,
33993 Self::ENCAPSULATED_DATA(..) => ENCAPSULATED_DATA_DATA::ID,
33994 Self::ESC_INFO(..) => ESC_INFO_DATA::ID,
33995 Self::ESC_STATUS(..) => ESC_STATUS_DATA::ID,
33996 Self::ESTIMATOR_STATUS(..) => ESTIMATOR_STATUS_DATA::ID,
33997 Self::EVENT(..) => EVENT_DATA::ID,
33998 Self::EXTENDED_SYS_STATE(..) => EXTENDED_SYS_STATE_DATA::ID,
33999 Self::FENCE_STATUS(..) => FENCE_STATUS_DATA::ID,
34000 Self::FILE_TRANSFER_PROTOCOL(..) => FILE_TRANSFER_PROTOCOL_DATA::ID,
34001 Self::FLIGHT_INFORMATION(..) => FLIGHT_INFORMATION_DATA::ID,
34002 Self::FOLLOW_TARGET(..) => FOLLOW_TARGET_DATA::ID,
34003 Self::FUEL_STATUS(..) => FUEL_STATUS_DATA::ID,
34004 Self::GENERATOR_STATUS(..) => GENERATOR_STATUS_DATA::ID,
34005 Self::GIMBAL_DEVICE_ATTITUDE_STATUS(..) => GIMBAL_DEVICE_ATTITUDE_STATUS_DATA::ID,
34006 Self::GIMBAL_DEVICE_INFORMATION(..) => GIMBAL_DEVICE_INFORMATION_DATA::ID,
34007 Self::GIMBAL_DEVICE_SET_ATTITUDE(..) => GIMBAL_DEVICE_SET_ATTITUDE_DATA::ID,
34008 Self::GIMBAL_MANAGER_INFORMATION(..) => GIMBAL_MANAGER_INFORMATION_DATA::ID,
34009 Self::GIMBAL_MANAGER_SET_ATTITUDE(..) => GIMBAL_MANAGER_SET_ATTITUDE_DATA::ID,
34010 Self::GIMBAL_MANAGER_SET_MANUAL_CONTROL(..) => {
34011 GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA::ID
34012 }
34013 Self::GIMBAL_MANAGER_SET_PITCHYAW(..) => GIMBAL_MANAGER_SET_PITCHYAW_DATA::ID,
34014 Self::GIMBAL_MANAGER_STATUS(..) => GIMBAL_MANAGER_STATUS_DATA::ID,
34015 Self::GLOBAL_POSITION_INT(..) => GLOBAL_POSITION_INT_DATA::ID,
34016 Self::GLOBAL_POSITION_INT_COV(..) => GLOBAL_POSITION_INT_COV_DATA::ID,
34017 Self::GLOBAL_VISION_POSITION_ESTIMATE(..) => GLOBAL_VISION_POSITION_ESTIMATE_DATA::ID,
34018 Self::GPS2_RAW(..) => GPS2_RAW_DATA::ID,
34019 Self::GPS2_RTK(..) => GPS2_RTK_DATA::ID,
34020 Self::GPS_GLOBAL_ORIGIN(..) => GPS_GLOBAL_ORIGIN_DATA::ID,
34021 Self::GPS_INJECT_DATA(..) => GPS_INJECT_DATA_DATA::ID,
34022 Self::GPS_INPUT(..) => GPS_INPUT_DATA::ID,
34023 Self::GPS_RAW_INT(..) => GPS_RAW_INT_DATA::ID,
34024 Self::GPS_RTCM_DATA(..) => GPS_RTCM_DATA_DATA::ID,
34025 Self::GPS_RTK(..) => GPS_RTK_DATA::ID,
34026 Self::GPS_STATUS(..) => GPS_STATUS_DATA::ID,
34027 Self::HEARTBEAT(..) => HEARTBEAT_DATA::ID,
34028 Self::HIGHRES_IMU(..) => HIGHRES_IMU_DATA::ID,
34029 Self::HIGH_LATENCY(..) => HIGH_LATENCY_DATA::ID,
34030 Self::HIGH_LATENCY2(..) => HIGH_LATENCY2_DATA::ID,
34031 Self::HIL_ACTUATOR_CONTROLS(..) => HIL_ACTUATOR_CONTROLS_DATA::ID,
34032 Self::HIL_CONTROLS(..) => HIL_CONTROLS_DATA::ID,
34033 Self::HIL_GPS(..) => HIL_GPS_DATA::ID,
34034 Self::HIL_OPTICAL_FLOW(..) => HIL_OPTICAL_FLOW_DATA::ID,
34035 Self::HIL_RC_INPUTS_RAW(..) => HIL_RC_INPUTS_RAW_DATA::ID,
34036 Self::HIL_SENSOR(..) => HIL_SENSOR_DATA::ID,
34037 Self::HIL_STATE(..) => HIL_STATE_DATA::ID,
34038 Self::HIL_STATE_QUATERNION(..) => HIL_STATE_QUATERNION_DATA::ID,
34039 Self::HOME_POSITION(..) => HOME_POSITION_DATA::ID,
34040 Self::HYGROMETER_SENSOR(..) => HYGROMETER_SENSOR_DATA::ID,
34041 Self::ILLUMINATOR_STATUS(..) => ILLUMINATOR_STATUS_DATA::ID,
34042 Self::ISBD_LINK_STATUS(..) => ISBD_LINK_STATUS_DATA::ID,
34043 Self::LANDING_TARGET(..) => LANDING_TARGET_DATA::ID,
34044 Self::LINK_NODE_STATUS(..) => LINK_NODE_STATUS_DATA::ID,
34045 Self::LOCAL_POSITION_NED(..) => LOCAL_POSITION_NED_DATA::ID,
34046 Self::LOCAL_POSITION_NED_COV(..) => LOCAL_POSITION_NED_COV_DATA::ID,
34047 Self::LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET(..) => {
34048 LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA::ID
34049 }
34050 Self::LOGGING_ACK(..) => LOGGING_ACK_DATA::ID,
34051 Self::LOGGING_DATA(..) => LOGGING_DATA_DATA::ID,
34052 Self::LOGGING_DATA_ACKED(..) => LOGGING_DATA_ACKED_DATA::ID,
34053 Self::LOG_DATA(..) => LOG_DATA_DATA::ID,
34054 Self::LOG_ENTRY(..) => LOG_ENTRY_DATA::ID,
34055 Self::LOG_ERASE(..) => LOG_ERASE_DATA::ID,
34056 Self::LOG_REQUEST_DATA(..) => LOG_REQUEST_DATA_DATA::ID,
34057 Self::LOG_REQUEST_END(..) => LOG_REQUEST_END_DATA::ID,
34058 Self::LOG_REQUEST_LIST(..) => LOG_REQUEST_LIST_DATA::ID,
34059 Self::MAG_CAL_REPORT(..) => MAG_CAL_REPORT_DATA::ID,
34060 Self::MANUAL_CONTROL(..) => MANUAL_CONTROL_DATA::ID,
34061 Self::MANUAL_SETPOINT(..) => MANUAL_SETPOINT_DATA::ID,
34062 Self::MEMORY_VECT(..) => MEMORY_VECT_DATA::ID,
34063 Self::MESSAGE_INTERVAL(..) => MESSAGE_INTERVAL_DATA::ID,
34064 Self::MISSION_ACK(..) => MISSION_ACK_DATA::ID,
34065 Self::MISSION_CLEAR_ALL(..) => MISSION_CLEAR_ALL_DATA::ID,
34066 Self::MISSION_COUNT(..) => MISSION_COUNT_DATA::ID,
34067 Self::MISSION_CURRENT(..) => MISSION_CURRENT_DATA::ID,
34068 Self::MISSION_ITEM(..) => MISSION_ITEM_DATA::ID,
34069 Self::MISSION_ITEM_INT(..) => MISSION_ITEM_INT_DATA::ID,
34070 Self::MISSION_ITEM_REACHED(..) => MISSION_ITEM_REACHED_DATA::ID,
34071 Self::MISSION_REQUEST(..) => MISSION_REQUEST_DATA::ID,
34072 Self::MISSION_REQUEST_INT(..) => MISSION_REQUEST_INT_DATA::ID,
34073 Self::MISSION_REQUEST_LIST(..) => MISSION_REQUEST_LIST_DATA::ID,
34074 Self::MISSION_REQUEST_PARTIAL_LIST(..) => MISSION_REQUEST_PARTIAL_LIST_DATA::ID,
34075 Self::MISSION_SET_CURRENT(..) => MISSION_SET_CURRENT_DATA::ID,
34076 Self::MISSION_WRITE_PARTIAL_LIST(..) => MISSION_WRITE_PARTIAL_LIST_DATA::ID,
34077 Self::MOUNT_ORIENTATION(..) => MOUNT_ORIENTATION_DATA::ID,
34078 Self::NAMED_VALUE_FLOAT(..) => NAMED_VALUE_FLOAT_DATA::ID,
34079 Self::NAMED_VALUE_INT(..) => NAMED_VALUE_INT_DATA::ID,
34080 Self::NAV_CONTROLLER_OUTPUT(..) => NAV_CONTROLLER_OUTPUT_DATA::ID,
34081 Self::OBSTACLE_DISTANCE(..) => OBSTACLE_DISTANCE_DATA::ID,
34082 Self::ODOMETRY(..) => ODOMETRY_DATA::ID,
34083 Self::ONBOARD_COMPUTER_STATUS(..) => ONBOARD_COMPUTER_STATUS_DATA::ID,
34084 Self::OPEN_DRONE_ID_ARM_STATUS(..) => OPEN_DRONE_ID_ARM_STATUS_DATA::ID,
34085 Self::OPEN_DRONE_ID_AUTHENTICATION(..) => OPEN_DRONE_ID_AUTHENTICATION_DATA::ID,
34086 Self::OPEN_DRONE_ID_BASIC_ID(..) => OPEN_DRONE_ID_BASIC_ID_DATA::ID,
34087 Self::OPEN_DRONE_ID_LOCATION(..) => OPEN_DRONE_ID_LOCATION_DATA::ID,
34088 Self::OPEN_DRONE_ID_MESSAGE_PACK(..) => OPEN_DRONE_ID_MESSAGE_PACK_DATA::ID,
34089 Self::OPEN_DRONE_ID_OPERATOR_ID(..) => OPEN_DRONE_ID_OPERATOR_ID_DATA::ID,
34090 Self::OPEN_DRONE_ID_SELF_ID(..) => OPEN_DRONE_ID_SELF_ID_DATA::ID,
34091 Self::OPEN_DRONE_ID_SYSTEM(..) => OPEN_DRONE_ID_SYSTEM_DATA::ID,
34092 Self::OPEN_DRONE_ID_SYSTEM_UPDATE(..) => OPEN_DRONE_ID_SYSTEM_UPDATE_DATA::ID,
34093 Self::OPTICAL_FLOW(..) => OPTICAL_FLOW_DATA::ID,
34094 Self::OPTICAL_FLOW_RAD(..) => OPTICAL_FLOW_RAD_DATA::ID,
34095 Self::ORBIT_EXECUTION_STATUS(..) => ORBIT_EXECUTION_STATUS_DATA::ID,
34096 Self::PARAM_EXT_ACK(..) => PARAM_EXT_ACK_DATA::ID,
34097 Self::PARAM_EXT_REQUEST_LIST(..) => PARAM_EXT_REQUEST_LIST_DATA::ID,
34098 Self::PARAM_EXT_REQUEST_READ(..) => PARAM_EXT_REQUEST_READ_DATA::ID,
34099 Self::PARAM_EXT_SET(..) => PARAM_EXT_SET_DATA::ID,
34100 Self::PARAM_EXT_VALUE(..) => PARAM_EXT_VALUE_DATA::ID,
34101 Self::PARAM_MAP_RC(..) => PARAM_MAP_RC_DATA::ID,
34102 Self::PARAM_REQUEST_LIST(..) => PARAM_REQUEST_LIST_DATA::ID,
34103 Self::PARAM_REQUEST_READ(..) => PARAM_REQUEST_READ_DATA::ID,
34104 Self::PARAM_SET(..) => PARAM_SET_DATA::ID,
34105 Self::PARAM_VALUE(..) => PARAM_VALUE_DATA::ID,
34106 Self::PING(..) => PING_DATA::ID,
34107 Self::PLAY_TUNE(..) => PLAY_TUNE_DATA::ID,
34108 Self::PLAY_TUNE_V2(..) => PLAY_TUNE_V2_DATA::ID,
34109 Self::POSITION_TARGET_GLOBAL_INT(..) => POSITION_TARGET_GLOBAL_INT_DATA::ID,
34110 Self::POSITION_TARGET_LOCAL_NED(..) => POSITION_TARGET_LOCAL_NED_DATA::ID,
34111 Self::POWER_STATUS(..) => POWER_STATUS_DATA::ID,
34112 Self::PROTOCOL_VERSION(..) => PROTOCOL_VERSION_DATA::ID,
34113 Self::RADIO_STATUS(..) => RADIO_STATUS_DATA::ID,
34114 Self::RAW_IMU(..) => RAW_IMU_DATA::ID,
34115 Self::RAW_PRESSURE(..) => RAW_PRESSURE_DATA::ID,
34116 Self::RAW_RPM(..) => RAW_RPM_DATA::ID,
34117 Self::RC_CHANNELS(..) => RC_CHANNELS_DATA::ID,
34118 Self::RC_CHANNELS_OVERRIDE(..) => RC_CHANNELS_OVERRIDE_DATA::ID,
34119 Self::RC_CHANNELS_RAW(..) => RC_CHANNELS_RAW_DATA::ID,
34120 Self::RC_CHANNELS_SCALED(..) => RC_CHANNELS_SCALED_DATA::ID,
34121 Self::REQUEST_DATA_STREAM(..) => REQUEST_DATA_STREAM_DATA::ID,
34122 Self::REQUEST_EVENT(..) => REQUEST_EVENT_DATA::ID,
34123 Self::RESOURCE_REQUEST(..) => RESOURCE_REQUEST_DATA::ID,
34124 Self::RESPONSE_EVENT_ERROR(..) => RESPONSE_EVENT_ERROR_DATA::ID,
34125 Self::SAFETY_ALLOWED_AREA(..) => SAFETY_ALLOWED_AREA_DATA::ID,
34126 Self::SAFETY_SET_ALLOWED_AREA(..) => SAFETY_SET_ALLOWED_AREA_DATA::ID,
34127 Self::SCALED_IMU(..) => SCALED_IMU_DATA::ID,
34128 Self::SCALED_IMU2(..) => SCALED_IMU2_DATA::ID,
34129 Self::SCALED_IMU3(..) => SCALED_IMU3_DATA::ID,
34130 Self::SCALED_PRESSURE(..) => SCALED_PRESSURE_DATA::ID,
34131 Self::SCALED_PRESSURE2(..) => SCALED_PRESSURE2_DATA::ID,
34132 Self::SCALED_PRESSURE3(..) => SCALED_PRESSURE3_DATA::ID,
34133 Self::SERIAL_CONTROL(..) => SERIAL_CONTROL_DATA::ID,
34134 Self::SERVO_OUTPUT_RAW(..) => SERVO_OUTPUT_RAW_DATA::ID,
34135 Self::SETUP_SIGNING(..) => SETUP_SIGNING_DATA::ID,
34136 Self::SET_ACTUATOR_CONTROL_TARGET(..) => SET_ACTUATOR_CONTROL_TARGET_DATA::ID,
34137 Self::SET_ATTITUDE_TARGET(..) => SET_ATTITUDE_TARGET_DATA::ID,
34138 Self::SET_GPS_GLOBAL_ORIGIN(..) => SET_GPS_GLOBAL_ORIGIN_DATA::ID,
34139 Self::SET_HOME_POSITION(..) => SET_HOME_POSITION_DATA::ID,
34140 Self::SET_MODE(..) => SET_MODE_DATA::ID,
34141 Self::SET_POSITION_TARGET_GLOBAL_INT(..) => SET_POSITION_TARGET_GLOBAL_INT_DATA::ID,
34142 Self::SET_POSITION_TARGET_LOCAL_NED(..) => SET_POSITION_TARGET_LOCAL_NED_DATA::ID,
34143 Self::SIM_STATE(..) => SIM_STATE_DATA::ID,
34144 Self::SMART_BATTERY_INFO(..) => SMART_BATTERY_INFO_DATA::ID,
34145 Self::STATUSTEXT(..) => STATUSTEXT_DATA::ID,
34146 Self::STORAGE_INFORMATION(..) => STORAGE_INFORMATION_DATA::ID,
34147 Self::SUPPORTED_TUNES(..) => SUPPORTED_TUNES_DATA::ID,
34148 Self::SYSTEM_TIME(..) => SYSTEM_TIME_DATA::ID,
34149 Self::SYS_STATUS(..) => SYS_STATUS_DATA::ID,
34150 Self::TERRAIN_CHECK(..) => TERRAIN_CHECK_DATA::ID,
34151 Self::TERRAIN_DATA(..) => TERRAIN_DATA_DATA::ID,
34152 Self::TERRAIN_REPORT(..) => TERRAIN_REPORT_DATA::ID,
34153 Self::TERRAIN_REQUEST(..) => TERRAIN_REQUEST_DATA::ID,
34154 Self::TIMESYNC(..) => TIMESYNC_DATA::ID,
34155 Self::TIME_ESTIMATE_TO_TARGET(..) => TIME_ESTIMATE_TO_TARGET_DATA::ID,
34156 Self::TRAJECTORY_REPRESENTATION_BEZIER(..) => TRAJECTORY_REPRESENTATION_BEZIER_DATA::ID,
34157 Self::TRAJECTORY_REPRESENTATION_WAYPOINTS(..) => {
34158 TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA::ID
34159 }
34160 Self::TUNNEL(..) => TUNNEL_DATA::ID,
34161 Self::UAVCAN_NODE_INFO(..) => UAVCAN_NODE_INFO_DATA::ID,
34162 Self::UAVCAN_NODE_STATUS(..) => UAVCAN_NODE_STATUS_DATA::ID,
34163 Self::UTM_GLOBAL_POSITION(..) => UTM_GLOBAL_POSITION_DATA::ID,
34164 Self::V2_EXTENSION(..) => V2_EXTENSION_DATA::ID,
34165 Self::VFR_HUD(..) => VFR_HUD_DATA::ID,
34166 Self::VIBRATION(..) => VIBRATION_DATA::ID,
34167 Self::VICON_POSITION_ESTIMATE(..) => VICON_POSITION_ESTIMATE_DATA::ID,
34168 Self::VIDEO_STREAM_INFORMATION(..) => VIDEO_STREAM_INFORMATION_DATA::ID,
34169 Self::VIDEO_STREAM_STATUS(..) => VIDEO_STREAM_STATUS_DATA::ID,
34170 Self::VISION_POSITION_ESTIMATE(..) => VISION_POSITION_ESTIMATE_DATA::ID,
34171 Self::VISION_SPEED_ESTIMATE(..) => VISION_SPEED_ESTIMATE_DATA::ID,
34172 Self::WHEEL_DISTANCE(..) => WHEEL_DISTANCE_DATA::ID,
34173 Self::WIFI_CONFIG_AP(..) => WIFI_CONFIG_AP_DATA::ID,
34174 Self::WINCH_STATUS(..) => WINCH_STATUS_DATA::ID,
34175 Self::WIND_COV(..) => WIND_COV_DATA::ID,
34176 }
34177 }
34178 fn message_id_from_name(name: &str) -> Option<u32> {
34179 match name {
34180 ACTUATOR_CONTROL_TARGET_DATA::NAME => Some(ACTUATOR_CONTROL_TARGET_DATA::ID),
34181 ACTUATOR_OUTPUT_STATUS_DATA::NAME => Some(ACTUATOR_OUTPUT_STATUS_DATA::ID),
34182 ADSB_VEHICLE_DATA::NAME => Some(ADSB_VEHICLE_DATA::ID),
34183 AIS_VESSEL_DATA::NAME => Some(AIS_VESSEL_DATA::ID),
34184 ALTITUDE_DATA::NAME => Some(ALTITUDE_DATA::ID),
34185 ATTITUDE_DATA::NAME => Some(ATTITUDE_DATA::ID),
34186 ATTITUDE_QUATERNION_DATA::NAME => Some(ATTITUDE_QUATERNION_DATA::ID),
34187 ATTITUDE_QUATERNION_COV_DATA::NAME => Some(ATTITUDE_QUATERNION_COV_DATA::ID),
34188 ATTITUDE_TARGET_DATA::NAME => Some(ATTITUDE_TARGET_DATA::ID),
34189 ATT_POS_MOCAP_DATA::NAME => Some(ATT_POS_MOCAP_DATA::ID),
34190 AUTH_KEY_DATA::NAME => Some(AUTH_KEY_DATA::ID),
34191 AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA::NAME => {
34192 Some(AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA::ID)
34193 }
34194 AUTOPILOT_VERSION_DATA::NAME => Some(AUTOPILOT_VERSION_DATA::ID),
34195 AVAILABLE_MODES_DATA::NAME => Some(AVAILABLE_MODES_DATA::ID),
34196 AVAILABLE_MODES_MONITOR_DATA::NAME => Some(AVAILABLE_MODES_MONITOR_DATA::ID),
34197 BATTERY_INFO_DATA::NAME => Some(BATTERY_INFO_DATA::ID),
34198 BATTERY_STATUS_DATA::NAME => Some(BATTERY_STATUS_DATA::ID),
34199 BUTTON_CHANGE_DATA::NAME => Some(BUTTON_CHANGE_DATA::ID),
34200 CAMERA_CAPTURE_STATUS_DATA::NAME => Some(CAMERA_CAPTURE_STATUS_DATA::ID),
34201 CAMERA_FOV_STATUS_DATA::NAME => Some(CAMERA_FOV_STATUS_DATA::ID),
34202 CAMERA_IMAGE_CAPTURED_DATA::NAME => Some(CAMERA_IMAGE_CAPTURED_DATA::ID),
34203 CAMERA_INFORMATION_DATA::NAME => Some(CAMERA_INFORMATION_DATA::ID),
34204 CAMERA_SETTINGS_DATA::NAME => Some(CAMERA_SETTINGS_DATA::ID),
34205 CAMERA_THERMAL_RANGE_DATA::NAME => Some(CAMERA_THERMAL_RANGE_DATA::ID),
34206 CAMERA_TRACKING_GEO_STATUS_DATA::NAME => Some(CAMERA_TRACKING_GEO_STATUS_DATA::ID),
34207 CAMERA_TRACKING_IMAGE_STATUS_DATA::NAME => Some(CAMERA_TRACKING_IMAGE_STATUS_DATA::ID),
34208 CAMERA_TRIGGER_DATA::NAME => Some(CAMERA_TRIGGER_DATA::ID),
34209 CANFD_FRAME_DATA::NAME => Some(CANFD_FRAME_DATA::ID),
34210 CAN_FILTER_MODIFY_DATA::NAME => Some(CAN_FILTER_MODIFY_DATA::ID),
34211 CAN_FRAME_DATA::NAME => Some(CAN_FRAME_DATA::ID),
34212 CELLULAR_CONFIG_DATA::NAME => Some(CELLULAR_CONFIG_DATA::ID),
34213 CELLULAR_STATUS_DATA::NAME => Some(CELLULAR_STATUS_DATA::ID),
34214 CHANGE_OPERATOR_CONTROL_DATA::NAME => Some(CHANGE_OPERATOR_CONTROL_DATA::ID),
34215 CHANGE_OPERATOR_CONTROL_ACK_DATA::NAME => Some(CHANGE_OPERATOR_CONTROL_ACK_DATA::ID),
34216 COLLISION_DATA::NAME => Some(COLLISION_DATA::ID),
34217 COMMAND_ACK_DATA::NAME => Some(COMMAND_ACK_DATA::ID),
34218 COMMAND_CANCEL_DATA::NAME => Some(COMMAND_CANCEL_DATA::ID),
34219 COMMAND_INT_DATA::NAME => Some(COMMAND_INT_DATA::ID),
34220 COMMAND_LONG_DATA::NAME => Some(COMMAND_LONG_DATA::ID),
34221 COMPONENT_INFORMATION_DATA::NAME => Some(COMPONENT_INFORMATION_DATA::ID),
34222 COMPONENT_INFORMATION_BASIC_DATA::NAME => Some(COMPONENT_INFORMATION_BASIC_DATA::ID),
34223 COMPONENT_METADATA_DATA::NAME => Some(COMPONENT_METADATA_DATA::ID),
34224 CONTROL_SYSTEM_STATE_DATA::NAME => Some(CONTROL_SYSTEM_STATE_DATA::ID),
34225 CURRENT_EVENT_SEQUENCE_DATA::NAME => Some(CURRENT_EVENT_SEQUENCE_DATA::ID),
34226 CURRENT_MODE_DATA::NAME => Some(CURRENT_MODE_DATA::ID),
34227 DATA_STREAM_DATA::NAME => Some(DATA_STREAM_DATA::ID),
34228 DATA_TRANSMISSION_HANDSHAKE_DATA::NAME => Some(DATA_TRANSMISSION_HANDSHAKE_DATA::ID),
34229 DEBUG_DATA::NAME => Some(DEBUG_DATA::ID),
34230 DEBUG_FLOAT_ARRAY_DATA::NAME => Some(DEBUG_FLOAT_ARRAY_DATA::ID),
34231 DEBUG_VECT_DATA::NAME => Some(DEBUG_VECT_DATA::ID),
34232 DISTANCE_SENSOR_DATA::NAME => Some(DISTANCE_SENSOR_DATA::ID),
34233 EFI_STATUS_DATA::NAME => Some(EFI_STATUS_DATA::ID),
34234 ENCAPSULATED_DATA_DATA::NAME => Some(ENCAPSULATED_DATA_DATA::ID),
34235 ESC_INFO_DATA::NAME => Some(ESC_INFO_DATA::ID),
34236 ESC_STATUS_DATA::NAME => Some(ESC_STATUS_DATA::ID),
34237 ESTIMATOR_STATUS_DATA::NAME => Some(ESTIMATOR_STATUS_DATA::ID),
34238 EVENT_DATA::NAME => Some(EVENT_DATA::ID),
34239 EXTENDED_SYS_STATE_DATA::NAME => Some(EXTENDED_SYS_STATE_DATA::ID),
34240 FENCE_STATUS_DATA::NAME => Some(FENCE_STATUS_DATA::ID),
34241 FILE_TRANSFER_PROTOCOL_DATA::NAME => Some(FILE_TRANSFER_PROTOCOL_DATA::ID),
34242 FLIGHT_INFORMATION_DATA::NAME => Some(FLIGHT_INFORMATION_DATA::ID),
34243 FOLLOW_TARGET_DATA::NAME => Some(FOLLOW_TARGET_DATA::ID),
34244 FUEL_STATUS_DATA::NAME => Some(FUEL_STATUS_DATA::ID),
34245 GENERATOR_STATUS_DATA::NAME => Some(GENERATOR_STATUS_DATA::ID),
34246 GIMBAL_DEVICE_ATTITUDE_STATUS_DATA::NAME => {
34247 Some(GIMBAL_DEVICE_ATTITUDE_STATUS_DATA::ID)
34248 }
34249 GIMBAL_DEVICE_INFORMATION_DATA::NAME => Some(GIMBAL_DEVICE_INFORMATION_DATA::ID),
34250 GIMBAL_DEVICE_SET_ATTITUDE_DATA::NAME => Some(GIMBAL_DEVICE_SET_ATTITUDE_DATA::ID),
34251 GIMBAL_MANAGER_INFORMATION_DATA::NAME => Some(GIMBAL_MANAGER_INFORMATION_DATA::ID),
34252 GIMBAL_MANAGER_SET_ATTITUDE_DATA::NAME => Some(GIMBAL_MANAGER_SET_ATTITUDE_DATA::ID),
34253 GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA::NAME => {
34254 Some(GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA::ID)
34255 }
34256 GIMBAL_MANAGER_SET_PITCHYAW_DATA::NAME => Some(GIMBAL_MANAGER_SET_PITCHYAW_DATA::ID),
34257 GIMBAL_MANAGER_STATUS_DATA::NAME => Some(GIMBAL_MANAGER_STATUS_DATA::ID),
34258 GLOBAL_POSITION_INT_DATA::NAME => Some(GLOBAL_POSITION_INT_DATA::ID),
34259 GLOBAL_POSITION_INT_COV_DATA::NAME => Some(GLOBAL_POSITION_INT_COV_DATA::ID),
34260 GLOBAL_VISION_POSITION_ESTIMATE_DATA::NAME => {
34261 Some(GLOBAL_VISION_POSITION_ESTIMATE_DATA::ID)
34262 }
34263 GPS2_RAW_DATA::NAME => Some(GPS2_RAW_DATA::ID),
34264 GPS2_RTK_DATA::NAME => Some(GPS2_RTK_DATA::ID),
34265 GPS_GLOBAL_ORIGIN_DATA::NAME => Some(GPS_GLOBAL_ORIGIN_DATA::ID),
34266 GPS_INJECT_DATA_DATA::NAME => Some(GPS_INJECT_DATA_DATA::ID),
34267 GPS_INPUT_DATA::NAME => Some(GPS_INPUT_DATA::ID),
34268 GPS_RAW_INT_DATA::NAME => Some(GPS_RAW_INT_DATA::ID),
34269 GPS_RTCM_DATA_DATA::NAME => Some(GPS_RTCM_DATA_DATA::ID),
34270 GPS_RTK_DATA::NAME => Some(GPS_RTK_DATA::ID),
34271 GPS_STATUS_DATA::NAME => Some(GPS_STATUS_DATA::ID),
34272 HEARTBEAT_DATA::NAME => Some(HEARTBEAT_DATA::ID),
34273 HIGHRES_IMU_DATA::NAME => Some(HIGHRES_IMU_DATA::ID),
34274 HIGH_LATENCY_DATA::NAME => Some(HIGH_LATENCY_DATA::ID),
34275 HIGH_LATENCY2_DATA::NAME => Some(HIGH_LATENCY2_DATA::ID),
34276 HIL_ACTUATOR_CONTROLS_DATA::NAME => Some(HIL_ACTUATOR_CONTROLS_DATA::ID),
34277 HIL_CONTROLS_DATA::NAME => Some(HIL_CONTROLS_DATA::ID),
34278 HIL_GPS_DATA::NAME => Some(HIL_GPS_DATA::ID),
34279 HIL_OPTICAL_FLOW_DATA::NAME => Some(HIL_OPTICAL_FLOW_DATA::ID),
34280 HIL_RC_INPUTS_RAW_DATA::NAME => Some(HIL_RC_INPUTS_RAW_DATA::ID),
34281 HIL_SENSOR_DATA::NAME => Some(HIL_SENSOR_DATA::ID),
34282 HIL_STATE_DATA::NAME => Some(HIL_STATE_DATA::ID),
34283 HIL_STATE_QUATERNION_DATA::NAME => Some(HIL_STATE_QUATERNION_DATA::ID),
34284 HOME_POSITION_DATA::NAME => Some(HOME_POSITION_DATA::ID),
34285 HYGROMETER_SENSOR_DATA::NAME => Some(HYGROMETER_SENSOR_DATA::ID),
34286 ILLUMINATOR_STATUS_DATA::NAME => Some(ILLUMINATOR_STATUS_DATA::ID),
34287 ISBD_LINK_STATUS_DATA::NAME => Some(ISBD_LINK_STATUS_DATA::ID),
34288 LANDING_TARGET_DATA::NAME => Some(LANDING_TARGET_DATA::ID),
34289 LINK_NODE_STATUS_DATA::NAME => Some(LINK_NODE_STATUS_DATA::ID),
34290 LOCAL_POSITION_NED_DATA::NAME => Some(LOCAL_POSITION_NED_DATA::ID),
34291 LOCAL_POSITION_NED_COV_DATA::NAME => Some(LOCAL_POSITION_NED_COV_DATA::ID),
34292 LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA::NAME => {
34293 Some(LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA::ID)
34294 }
34295 LOGGING_ACK_DATA::NAME => Some(LOGGING_ACK_DATA::ID),
34296 LOGGING_DATA_DATA::NAME => Some(LOGGING_DATA_DATA::ID),
34297 LOGGING_DATA_ACKED_DATA::NAME => Some(LOGGING_DATA_ACKED_DATA::ID),
34298 LOG_DATA_DATA::NAME => Some(LOG_DATA_DATA::ID),
34299 LOG_ENTRY_DATA::NAME => Some(LOG_ENTRY_DATA::ID),
34300 LOG_ERASE_DATA::NAME => Some(LOG_ERASE_DATA::ID),
34301 LOG_REQUEST_DATA_DATA::NAME => Some(LOG_REQUEST_DATA_DATA::ID),
34302 LOG_REQUEST_END_DATA::NAME => Some(LOG_REQUEST_END_DATA::ID),
34303 LOG_REQUEST_LIST_DATA::NAME => Some(LOG_REQUEST_LIST_DATA::ID),
34304 MAG_CAL_REPORT_DATA::NAME => Some(MAG_CAL_REPORT_DATA::ID),
34305 MANUAL_CONTROL_DATA::NAME => Some(MANUAL_CONTROL_DATA::ID),
34306 MANUAL_SETPOINT_DATA::NAME => Some(MANUAL_SETPOINT_DATA::ID),
34307 MEMORY_VECT_DATA::NAME => Some(MEMORY_VECT_DATA::ID),
34308 MESSAGE_INTERVAL_DATA::NAME => Some(MESSAGE_INTERVAL_DATA::ID),
34309 MISSION_ACK_DATA::NAME => Some(MISSION_ACK_DATA::ID),
34310 MISSION_CLEAR_ALL_DATA::NAME => Some(MISSION_CLEAR_ALL_DATA::ID),
34311 MISSION_COUNT_DATA::NAME => Some(MISSION_COUNT_DATA::ID),
34312 MISSION_CURRENT_DATA::NAME => Some(MISSION_CURRENT_DATA::ID),
34313 MISSION_ITEM_DATA::NAME => Some(MISSION_ITEM_DATA::ID),
34314 MISSION_ITEM_INT_DATA::NAME => Some(MISSION_ITEM_INT_DATA::ID),
34315 MISSION_ITEM_REACHED_DATA::NAME => Some(MISSION_ITEM_REACHED_DATA::ID),
34316 MISSION_REQUEST_DATA::NAME => Some(MISSION_REQUEST_DATA::ID),
34317 MISSION_REQUEST_INT_DATA::NAME => Some(MISSION_REQUEST_INT_DATA::ID),
34318 MISSION_REQUEST_LIST_DATA::NAME => Some(MISSION_REQUEST_LIST_DATA::ID),
34319 MISSION_REQUEST_PARTIAL_LIST_DATA::NAME => Some(MISSION_REQUEST_PARTIAL_LIST_DATA::ID),
34320 MISSION_SET_CURRENT_DATA::NAME => Some(MISSION_SET_CURRENT_DATA::ID),
34321 MISSION_WRITE_PARTIAL_LIST_DATA::NAME => Some(MISSION_WRITE_PARTIAL_LIST_DATA::ID),
34322 MOUNT_ORIENTATION_DATA::NAME => Some(MOUNT_ORIENTATION_DATA::ID),
34323 NAMED_VALUE_FLOAT_DATA::NAME => Some(NAMED_VALUE_FLOAT_DATA::ID),
34324 NAMED_VALUE_INT_DATA::NAME => Some(NAMED_VALUE_INT_DATA::ID),
34325 NAV_CONTROLLER_OUTPUT_DATA::NAME => Some(NAV_CONTROLLER_OUTPUT_DATA::ID),
34326 OBSTACLE_DISTANCE_DATA::NAME => Some(OBSTACLE_DISTANCE_DATA::ID),
34327 ODOMETRY_DATA::NAME => Some(ODOMETRY_DATA::ID),
34328 ONBOARD_COMPUTER_STATUS_DATA::NAME => Some(ONBOARD_COMPUTER_STATUS_DATA::ID),
34329 OPEN_DRONE_ID_ARM_STATUS_DATA::NAME => Some(OPEN_DRONE_ID_ARM_STATUS_DATA::ID),
34330 OPEN_DRONE_ID_AUTHENTICATION_DATA::NAME => Some(OPEN_DRONE_ID_AUTHENTICATION_DATA::ID),
34331 OPEN_DRONE_ID_BASIC_ID_DATA::NAME => Some(OPEN_DRONE_ID_BASIC_ID_DATA::ID),
34332 OPEN_DRONE_ID_LOCATION_DATA::NAME => Some(OPEN_DRONE_ID_LOCATION_DATA::ID),
34333 OPEN_DRONE_ID_MESSAGE_PACK_DATA::NAME => Some(OPEN_DRONE_ID_MESSAGE_PACK_DATA::ID),
34334 OPEN_DRONE_ID_OPERATOR_ID_DATA::NAME => Some(OPEN_DRONE_ID_OPERATOR_ID_DATA::ID),
34335 OPEN_DRONE_ID_SELF_ID_DATA::NAME => Some(OPEN_DRONE_ID_SELF_ID_DATA::ID),
34336 OPEN_DRONE_ID_SYSTEM_DATA::NAME => Some(OPEN_DRONE_ID_SYSTEM_DATA::ID),
34337 OPEN_DRONE_ID_SYSTEM_UPDATE_DATA::NAME => Some(OPEN_DRONE_ID_SYSTEM_UPDATE_DATA::ID),
34338 OPTICAL_FLOW_DATA::NAME => Some(OPTICAL_FLOW_DATA::ID),
34339 OPTICAL_FLOW_RAD_DATA::NAME => Some(OPTICAL_FLOW_RAD_DATA::ID),
34340 ORBIT_EXECUTION_STATUS_DATA::NAME => Some(ORBIT_EXECUTION_STATUS_DATA::ID),
34341 PARAM_EXT_ACK_DATA::NAME => Some(PARAM_EXT_ACK_DATA::ID),
34342 PARAM_EXT_REQUEST_LIST_DATA::NAME => Some(PARAM_EXT_REQUEST_LIST_DATA::ID),
34343 PARAM_EXT_REQUEST_READ_DATA::NAME => Some(PARAM_EXT_REQUEST_READ_DATA::ID),
34344 PARAM_EXT_SET_DATA::NAME => Some(PARAM_EXT_SET_DATA::ID),
34345 PARAM_EXT_VALUE_DATA::NAME => Some(PARAM_EXT_VALUE_DATA::ID),
34346 PARAM_MAP_RC_DATA::NAME => Some(PARAM_MAP_RC_DATA::ID),
34347 PARAM_REQUEST_LIST_DATA::NAME => Some(PARAM_REQUEST_LIST_DATA::ID),
34348 PARAM_REQUEST_READ_DATA::NAME => Some(PARAM_REQUEST_READ_DATA::ID),
34349 PARAM_SET_DATA::NAME => Some(PARAM_SET_DATA::ID),
34350 PARAM_VALUE_DATA::NAME => Some(PARAM_VALUE_DATA::ID),
34351 PING_DATA::NAME => Some(PING_DATA::ID),
34352 PLAY_TUNE_DATA::NAME => Some(PLAY_TUNE_DATA::ID),
34353 PLAY_TUNE_V2_DATA::NAME => Some(PLAY_TUNE_V2_DATA::ID),
34354 POSITION_TARGET_GLOBAL_INT_DATA::NAME => Some(POSITION_TARGET_GLOBAL_INT_DATA::ID),
34355 POSITION_TARGET_LOCAL_NED_DATA::NAME => Some(POSITION_TARGET_LOCAL_NED_DATA::ID),
34356 POWER_STATUS_DATA::NAME => Some(POWER_STATUS_DATA::ID),
34357 PROTOCOL_VERSION_DATA::NAME => Some(PROTOCOL_VERSION_DATA::ID),
34358 RADIO_STATUS_DATA::NAME => Some(RADIO_STATUS_DATA::ID),
34359 RAW_IMU_DATA::NAME => Some(RAW_IMU_DATA::ID),
34360 RAW_PRESSURE_DATA::NAME => Some(RAW_PRESSURE_DATA::ID),
34361 RAW_RPM_DATA::NAME => Some(RAW_RPM_DATA::ID),
34362 RC_CHANNELS_DATA::NAME => Some(RC_CHANNELS_DATA::ID),
34363 RC_CHANNELS_OVERRIDE_DATA::NAME => Some(RC_CHANNELS_OVERRIDE_DATA::ID),
34364 RC_CHANNELS_RAW_DATA::NAME => Some(RC_CHANNELS_RAW_DATA::ID),
34365 RC_CHANNELS_SCALED_DATA::NAME => Some(RC_CHANNELS_SCALED_DATA::ID),
34366 REQUEST_DATA_STREAM_DATA::NAME => Some(REQUEST_DATA_STREAM_DATA::ID),
34367 REQUEST_EVENT_DATA::NAME => Some(REQUEST_EVENT_DATA::ID),
34368 RESOURCE_REQUEST_DATA::NAME => Some(RESOURCE_REQUEST_DATA::ID),
34369 RESPONSE_EVENT_ERROR_DATA::NAME => Some(RESPONSE_EVENT_ERROR_DATA::ID),
34370 SAFETY_ALLOWED_AREA_DATA::NAME => Some(SAFETY_ALLOWED_AREA_DATA::ID),
34371 SAFETY_SET_ALLOWED_AREA_DATA::NAME => Some(SAFETY_SET_ALLOWED_AREA_DATA::ID),
34372 SCALED_IMU_DATA::NAME => Some(SCALED_IMU_DATA::ID),
34373 SCALED_IMU2_DATA::NAME => Some(SCALED_IMU2_DATA::ID),
34374 SCALED_IMU3_DATA::NAME => Some(SCALED_IMU3_DATA::ID),
34375 SCALED_PRESSURE_DATA::NAME => Some(SCALED_PRESSURE_DATA::ID),
34376 SCALED_PRESSURE2_DATA::NAME => Some(SCALED_PRESSURE2_DATA::ID),
34377 SCALED_PRESSURE3_DATA::NAME => Some(SCALED_PRESSURE3_DATA::ID),
34378 SERIAL_CONTROL_DATA::NAME => Some(SERIAL_CONTROL_DATA::ID),
34379 SERVO_OUTPUT_RAW_DATA::NAME => Some(SERVO_OUTPUT_RAW_DATA::ID),
34380 SETUP_SIGNING_DATA::NAME => Some(SETUP_SIGNING_DATA::ID),
34381 SET_ACTUATOR_CONTROL_TARGET_DATA::NAME => Some(SET_ACTUATOR_CONTROL_TARGET_DATA::ID),
34382 SET_ATTITUDE_TARGET_DATA::NAME => Some(SET_ATTITUDE_TARGET_DATA::ID),
34383 SET_GPS_GLOBAL_ORIGIN_DATA::NAME => Some(SET_GPS_GLOBAL_ORIGIN_DATA::ID),
34384 SET_HOME_POSITION_DATA::NAME => Some(SET_HOME_POSITION_DATA::ID),
34385 SET_MODE_DATA::NAME => Some(SET_MODE_DATA::ID),
34386 SET_POSITION_TARGET_GLOBAL_INT_DATA::NAME => {
34387 Some(SET_POSITION_TARGET_GLOBAL_INT_DATA::ID)
34388 }
34389 SET_POSITION_TARGET_LOCAL_NED_DATA::NAME => {
34390 Some(SET_POSITION_TARGET_LOCAL_NED_DATA::ID)
34391 }
34392 SIM_STATE_DATA::NAME => Some(SIM_STATE_DATA::ID),
34393 SMART_BATTERY_INFO_DATA::NAME => Some(SMART_BATTERY_INFO_DATA::ID),
34394 STATUSTEXT_DATA::NAME => Some(STATUSTEXT_DATA::ID),
34395 STORAGE_INFORMATION_DATA::NAME => Some(STORAGE_INFORMATION_DATA::ID),
34396 SUPPORTED_TUNES_DATA::NAME => Some(SUPPORTED_TUNES_DATA::ID),
34397 SYSTEM_TIME_DATA::NAME => Some(SYSTEM_TIME_DATA::ID),
34398 SYS_STATUS_DATA::NAME => Some(SYS_STATUS_DATA::ID),
34399 TERRAIN_CHECK_DATA::NAME => Some(TERRAIN_CHECK_DATA::ID),
34400 TERRAIN_DATA_DATA::NAME => Some(TERRAIN_DATA_DATA::ID),
34401 TERRAIN_REPORT_DATA::NAME => Some(TERRAIN_REPORT_DATA::ID),
34402 TERRAIN_REQUEST_DATA::NAME => Some(TERRAIN_REQUEST_DATA::ID),
34403 TIMESYNC_DATA::NAME => Some(TIMESYNC_DATA::ID),
34404 TIME_ESTIMATE_TO_TARGET_DATA::NAME => Some(TIME_ESTIMATE_TO_TARGET_DATA::ID),
34405 TRAJECTORY_REPRESENTATION_BEZIER_DATA::NAME => {
34406 Some(TRAJECTORY_REPRESENTATION_BEZIER_DATA::ID)
34407 }
34408 TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA::NAME => {
34409 Some(TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA::ID)
34410 }
34411 TUNNEL_DATA::NAME => Some(TUNNEL_DATA::ID),
34412 UAVCAN_NODE_INFO_DATA::NAME => Some(UAVCAN_NODE_INFO_DATA::ID),
34413 UAVCAN_NODE_STATUS_DATA::NAME => Some(UAVCAN_NODE_STATUS_DATA::ID),
34414 UTM_GLOBAL_POSITION_DATA::NAME => Some(UTM_GLOBAL_POSITION_DATA::ID),
34415 V2_EXTENSION_DATA::NAME => Some(V2_EXTENSION_DATA::ID),
34416 VFR_HUD_DATA::NAME => Some(VFR_HUD_DATA::ID),
34417 VIBRATION_DATA::NAME => Some(VIBRATION_DATA::ID),
34418 VICON_POSITION_ESTIMATE_DATA::NAME => Some(VICON_POSITION_ESTIMATE_DATA::ID),
34419 VIDEO_STREAM_INFORMATION_DATA::NAME => Some(VIDEO_STREAM_INFORMATION_DATA::ID),
34420 VIDEO_STREAM_STATUS_DATA::NAME => Some(VIDEO_STREAM_STATUS_DATA::ID),
34421 VISION_POSITION_ESTIMATE_DATA::NAME => Some(VISION_POSITION_ESTIMATE_DATA::ID),
34422 VISION_SPEED_ESTIMATE_DATA::NAME => Some(VISION_SPEED_ESTIMATE_DATA::ID),
34423 WHEEL_DISTANCE_DATA::NAME => Some(WHEEL_DISTANCE_DATA::ID),
34424 WIFI_CONFIG_AP_DATA::NAME => Some(WIFI_CONFIG_AP_DATA::ID),
34425 WINCH_STATUS_DATA::NAME => Some(WINCH_STATUS_DATA::ID),
34426 WIND_COV_DATA::NAME => Some(WIND_COV_DATA::ID),
34427 _ => None,
34428 }
34429 }
34430 fn default_message_from_id(id: u32) -> Option<Self> {
34431 match id {
34432 ACTUATOR_CONTROL_TARGET_DATA::ID => Some(Self::ACTUATOR_CONTROL_TARGET(
34433 ACTUATOR_CONTROL_TARGET_DATA::default(),
34434 )),
34435 ACTUATOR_OUTPUT_STATUS_DATA::ID => Some(Self::ACTUATOR_OUTPUT_STATUS(
34436 ACTUATOR_OUTPUT_STATUS_DATA::default(),
34437 )),
34438 ADSB_VEHICLE_DATA::ID => Some(Self::ADSB_VEHICLE(ADSB_VEHICLE_DATA::default())),
34439 AIS_VESSEL_DATA::ID => Some(Self::AIS_VESSEL(AIS_VESSEL_DATA::default())),
34440 ALTITUDE_DATA::ID => Some(Self::ALTITUDE(ALTITUDE_DATA::default())),
34441 ATTITUDE_DATA::ID => Some(Self::ATTITUDE(ATTITUDE_DATA::default())),
34442 ATTITUDE_QUATERNION_DATA::ID => Some(Self::ATTITUDE_QUATERNION(
34443 ATTITUDE_QUATERNION_DATA::default(),
34444 )),
34445 ATTITUDE_QUATERNION_COV_DATA::ID => Some(Self::ATTITUDE_QUATERNION_COV(
34446 ATTITUDE_QUATERNION_COV_DATA::default(),
34447 )),
34448 ATTITUDE_TARGET_DATA::ID => {
34449 Some(Self::ATTITUDE_TARGET(ATTITUDE_TARGET_DATA::default()))
34450 }
34451 ATT_POS_MOCAP_DATA::ID => Some(Self::ATT_POS_MOCAP(ATT_POS_MOCAP_DATA::default())),
34452 AUTH_KEY_DATA::ID => Some(Self::AUTH_KEY(AUTH_KEY_DATA::default())),
34453 AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA::ID => {
34454 Some(Self::AUTOPILOT_STATE_FOR_GIMBAL_DEVICE(
34455 AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA::default(),
34456 ))
34457 }
34458 AUTOPILOT_VERSION_DATA::ID => {
34459 Some(Self::AUTOPILOT_VERSION(AUTOPILOT_VERSION_DATA::default()))
34460 }
34461 AVAILABLE_MODES_DATA::ID => {
34462 Some(Self::AVAILABLE_MODES(AVAILABLE_MODES_DATA::default()))
34463 }
34464 AVAILABLE_MODES_MONITOR_DATA::ID => Some(Self::AVAILABLE_MODES_MONITOR(
34465 AVAILABLE_MODES_MONITOR_DATA::default(),
34466 )),
34467 BATTERY_INFO_DATA::ID => Some(Self::BATTERY_INFO(BATTERY_INFO_DATA::default())),
34468 BATTERY_STATUS_DATA::ID => Some(Self::BATTERY_STATUS(BATTERY_STATUS_DATA::default())),
34469 BUTTON_CHANGE_DATA::ID => Some(Self::BUTTON_CHANGE(BUTTON_CHANGE_DATA::default())),
34470 CAMERA_CAPTURE_STATUS_DATA::ID => Some(Self::CAMERA_CAPTURE_STATUS(
34471 CAMERA_CAPTURE_STATUS_DATA::default(),
34472 )),
34473 CAMERA_FOV_STATUS_DATA::ID => {
34474 Some(Self::CAMERA_FOV_STATUS(CAMERA_FOV_STATUS_DATA::default()))
34475 }
34476 CAMERA_IMAGE_CAPTURED_DATA::ID => Some(Self::CAMERA_IMAGE_CAPTURED(
34477 CAMERA_IMAGE_CAPTURED_DATA::default(),
34478 )),
34479 CAMERA_INFORMATION_DATA::ID => {
34480 Some(Self::CAMERA_INFORMATION(CAMERA_INFORMATION_DATA::default()))
34481 }
34482 CAMERA_SETTINGS_DATA::ID => {
34483 Some(Self::CAMERA_SETTINGS(CAMERA_SETTINGS_DATA::default()))
34484 }
34485 CAMERA_THERMAL_RANGE_DATA::ID => Some(Self::CAMERA_THERMAL_RANGE(
34486 CAMERA_THERMAL_RANGE_DATA::default(),
34487 )),
34488 CAMERA_TRACKING_GEO_STATUS_DATA::ID => Some(Self::CAMERA_TRACKING_GEO_STATUS(
34489 CAMERA_TRACKING_GEO_STATUS_DATA::default(),
34490 )),
34491 CAMERA_TRACKING_IMAGE_STATUS_DATA::ID => Some(Self::CAMERA_TRACKING_IMAGE_STATUS(
34492 CAMERA_TRACKING_IMAGE_STATUS_DATA::default(),
34493 )),
34494 CAMERA_TRIGGER_DATA::ID => Some(Self::CAMERA_TRIGGER(CAMERA_TRIGGER_DATA::default())),
34495 CANFD_FRAME_DATA::ID => Some(Self::CANFD_FRAME(CANFD_FRAME_DATA::default())),
34496 CAN_FILTER_MODIFY_DATA::ID => {
34497 Some(Self::CAN_FILTER_MODIFY(CAN_FILTER_MODIFY_DATA::default()))
34498 }
34499 CAN_FRAME_DATA::ID => Some(Self::CAN_FRAME(CAN_FRAME_DATA::default())),
34500 CELLULAR_CONFIG_DATA::ID => {
34501 Some(Self::CELLULAR_CONFIG(CELLULAR_CONFIG_DATA::default()))
34502 }
34503 CELLULAR_STATUS_DATA::ID => {
34504 Some(Self::CELLULAR_STATUS(CELLULAR_STATUS_DATA::default()))
34505 }
34506 CHANGE_OPERATOR_CONTROL_DATA::ID => Some(Self::CHANGE_OPERATOR_CONTROL(
34507 CHANGE_OPERATOR_CONTROL_DATA::default(),
34508 )),
34509 CHANGE_OPERATOR_CONTROL_ACK_DATA::ID => Some(Self::CHANGE_OPERATOR_CONTROL_ACK(
34510 CHANGE_OPERATOR_CONTROL_ACK_DATA::default(),
34511 )),
34512 COLLISION_DATA::ID => Some(Self::COLLISION(COLLISION_DATA::default())),
34513 COMMAND_ACK_DATA::ID => Some(Self::COMMAND_ACK(COMMAND_ACK_DATA::default())),
34514 COMMAND_CANCEL_DATA::ID => Some(Self::COMMAND_CANCEL(COMMAND_CANCEL_DATA::default())),
34515 COMMAND_INT_DATA::ID => Some(Self::COMMAND_INT(COMMAND_INT_DATA::default())),
34516 COMMAND_LONG_DATA::ID => Some(Self::COMMAND_LONG(COMMAND_LONG_DATA::default())),
34517 COMPONENT_INFORMATION_DATA::ID => Some(Self::COMPONENT_INFORMATION(
34518 COMPONENT_INFORMATION_DATA::default(),
34519 )),
34520 COMPONENT_INFORMATION_BASIC_DATA::ID => Some(Self::COMPONENT_INFORMATION_BASIC(
34521 COMPONENT_INFORMATION_BASIC_DATA::default(),
34522 )),
34523 COMPONENT_METADATA_DATA::ID => {
34524 Some(Self::COMPONENT_METADATA(COMPONENT_METADATA_DATA::default()))
34525 }
34526 CONTROL_SYSTEM_STATE_DATA::ID => Some(Self::CONTROL_SYSTEM_STATE(
34527 CONTROL_SYSTEM_STATE_DATA::default(),
34528 )),
34529 CURRENT_EVENT_SEQUENCE_DATA::ID => Some(Self::CURRENT_EVENT_SEQUENCE(
34530 CURRENT_EVENT_SEQUENCE_DATA::default(),
34531 )),
34532 CURRENT_MODE_DATA::ID => Some(Self::CURRENT_MODE(CURRENT_MODE_DATA::default())),
34533 DATA_STREAM_DATA::ID => Some(Self::DATA_STREAM(DATA_STREAM_DATA::default())),
34534 DATA_TRANSMISSION_HANDSHAKE_DATA::ID => Some(Self::DATA_TRANSMISSION_HANDSHAKE(
34535 DATA_TRANSMISSION_HANDSHAKE_DATA::default(),
34536 )),
34537 DEBUG_DATA::ID => Some(Self::DEBUG(DEBUG_DATA::default())),
34538 DEBUG_FLOAT_ARRAY_DATA::ID => {
34539 Some(Self::DEBUG_FLOAT_ARRAY(DEBUG_FLOAT_ARRAY_DATA::default()))
34540 }
34541 DEBUG_VECT_DATA::ID => Some(Self::DEBUG_VECT(DEBUG_VECT_DATA::default())),
34542 DISTANCE_SENSOR_DATA::ID => {
34543 Some(Self::DISTANCE_SENSOR(DISTANCE_SENSOR_DATA::default()))
34544 }
34545 EFI_STATUS_DATA::ID => Some(Self::EFI_STATUS(EFI_STATUS_DATA::default())),
34546 ENCAPSULATED_DATA_DATA::ID => {
34547 Some(Self::ENCAPSULATED_DATA(ENCAPSULATED_DATA_DATA::default()))
34548 }
34549 ESC_INFO_DATA::ID => Some(Self::ESC_INFO(ESC_INFO_DATA::default())),
34550 ESC_STATUS_DATA::ID => Some(Self::ESC_STATUS(ESC_STATUS_DATA::default())),
34551 ESTIMATOR_STATUS_DATA::ID => {
34552 Some(Self::ESTIMATOR_STATUS(ESTIMATOR_STATUS_DATA::default()))
34553 }
34554 EVENT_DATA::ID => Some(Self::EVENT(EVENT_DATA::default())),
34555 EXTENDED_SYS_STATE_DATA::ID => {
34556 Some(Self::EXTENDED_SYS_STATE(EXTENDED_SYS_STATE_DATA::default()))
34557 }
34558 FENCE_STATUS_DATA::ID => Some(Self::FENCE_STATUS(FENCE_STATUS_DATA::default())),
34559 FILE_TRANSFER_PROTOCOL_DATA::ID => Some(Self::FILE_TRANSFER_PROTOCOL(
34560 FILE_TRANSFER_PROTOCOL_DATA::default(),
34561 )),
34562 FLIGHT_INFORMATION_DATA::ID => {
34563 Some(Self::FLIGHT_INFORMATION(FLIGHT_INFORMATION_DATA::default()))
34564 }
34565 FOLLOW_TARGET_DATA::ID => Some(Self::FOLLOW_TARGET(FOLLOW_TARGET_DATA::default())),
34566 FUEL_STATUS_DATA::ID => Some(Self::FUEL_STATUS(FUEL_STATUS_DATA::default())),
34567 GENERATOR_STATUS_DATA::ID => {
34568 Some(Self::GENERATOR_STATUS(GENERATOR_STATUS_DATA::default()))
34569 }
34570 GIMBAL_DEVICE_ATTITUDE_STATUS_DATA::ID => Some(Self::GIMBAL_DEVICE_ATTITUDE_STATUS(
34571 GIMBAL_DEVICE_ATTITUDE_STATUS_DATA::default(),
34572 )),
34573 GIMBAL_DEVICE_INFORMATION_DATA::ID => Some(Self::GIMBAL_DEVICE_INFORMATION(
34574 GIMBAL_DEVICE_INFORMATION_DATA::default(),
34575 )),
34576 GIMBAL_DEVICE_SET_ATTITUDE_DATA::ID => Some(Self::GIMBAL_DEVICE_SET_ATTITUDE(
34577 GIMBAL_DEVICE_SET_ATTITUDE_DATA::default(),
34578 )),
34579 GIMBAL_MANAGER_INFORMATION_DATA::ID => Some(Self::GIMBAL_MANAGER_INFORMATION(
34580 GIMBAL_MANAGER_INFORMATION_DATA::default(),
34581 )),
34582 GIMBAL_MANAGER_SET_ATTITUDE_DATA::ID => Some(Self::GIMBAL_MANAGER_SET_ATTITUDE(
34583 GIMBAL_MANAGER_SET_ATTITUDE_DATA::default(),
34584 )),
34585 GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA::ID => {
34586 Some(Self::GIMBAL_MANAGER_SET_MANUAL_CONTROL(
34587 GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA::default(),
34588 ))
34589 }
34590 GIMBAL_MANAGER_SET_PITCHYAW_DATA::ID => Some(Self::GIMBAL_MANAGER_SET_PITCHYAW(
34591 GIMBAL_MANAGER_SET_PITCHYAW_DATA::default(),
34592 )),
34593 GIMBAL_MANAGER_STATUS_DATA::ID => Some(Self::GIMBAL_MANAGER_STATUS(
34594 GIMBAL_MANAGER_STATUS_DATA::default(),
34595 )),
34596 GLOBAL_POSITION_INT_DATA::ID => Some(Self::GLOBAL_POSITION_INT(
34597 GLOBAL_POSITION_INT_DATA::default(),
34598 )),
34599 GLOBAL_POSITION_INT_COV_DATA::ID => Some(Self::GLOBAL_POSITION_INT_COV(
34600 GLOBAL_POSITION_INT_COV_DATA::default(),
34601 )),
34602 GLOBAL_VISION_POSITION_ESTIMATE_DATA::ID => {
34603 Some(Self::GLOBAL_VISION_POSITION_ESTIMATE(
34604 GLOBAL_VISION_POSITION_ESTIMATE_DATA::default(),
34605 ))
34606 }
34607 GPS2_RAW_DATA::ID => Some(Self::GPS2_RAW(GPS2_RAW_DATA::default())),
34608 GPS2_RTK_DATA::ID => Some(Self::GPS2_RTK(GPS2_RTK_DATA::default())),
34609 GPS_GLOBAL_ORIGIN_DATA::ID => {
34610 Some(Self::GPS_GLOBAL_ORIGIN(GPS_GLOBAL_ORIGIN_DATA::default()))
34611 }
34612 GPS_INJECT_DATA_DATA::ID => {
34613 Some(Self::GPS_INJECT_DATA(GPS_INJECT_DATA_DATA::default()))
34614 }
34615 GPS_INPUT_DATA::ID => Some(Self::GPS_INPUT(GPS_INPUT_DATA::default())),
34616 GPS_RAW_INT_DATA::ID => Some(Self::GPS_RAW_INT(GPS_RAW_INT_DATA::default())),
34617 GPS_RTCM_DATA_DATA::ID => Some(Self::GPS_RTCM_DATA(GPS_RTCM_DATA_DATA::default())),
34618 GPS_RTK_DATA::ID => Some(Self::GPS_RTK(GPS_RTK_DATA::default())),
34619 GPS_STATUS_DATA::ID => Some(Self::GPS_STATUS(GPS_STATUS_DATA::default())),
34620 HEARTBEAT_DATA::ID => Some(Self::HEARTBEAT(HEARTBEAT_DATA::default())),
34621 HIGHRES_IMU_DATA::ID => Some(Self::HIGHRES_IMU(HIGHRES_IMU_DATA::default())),
34622 HIGH_LATENCY_DATA::ID => Some(Self::HIGH_LATENCY(HIGH_LATENCY_DATA::default())),
34623 HIGH_LATENCY2_DATA::ID => Some(Self::HIGH_LATENCY2(HIGH_LATENCY2_DATA::default())),
34624 HIL_ACTUATOR_CONTROLS_DATA::ID => Some(Self::HIL_ACTUATOR_CONTROLS(
34625 HIL_ACTUATOR_CONTROLS_DATA::default(),
34626 )),
34627 HIL_CONTROLS_DATA::ID => Some(Self::HIL_CONTROLS(HIL_CONTROLS_DATA::default())),
34628 HIL_GPS_DATA::ID => Some(Self::HIL_GPS(HIL_GPS_DATA::default())),
34629 HIL_OPTICAL_FLOW_DATA::ID => {
34630 Some(Self::HIL_OPTICAL_FLOW(HIL_OPTICAL_FLOW_DATA::default()))
34631 }
34632 HIL_RC_INPUTS_RAW_DATA::ID => {
34633 Some(Self::HIL_RC_INPUTS_RAW(HIL_RC_INPUTS_RAW_DATA::default()))
34634 }
34635 HIL_SENSOR_DATA::ID => Some(Self::HIL_SENSOR(HIL_SENSOR_DATA::default())),
34636 HIL_STATE_DATA::ID => Some(Self::HIL_STATE(HIL_STATE_DATA::default())),
34637 HIL_STATE_QUATERNION_DATA::ID => Some(Self::HIL_STATE_QUATERNION(
34638 HIL_STATE_QUATERNION_DATA::default(),
34639 )),
34640 HOME_POSITION_DATA::ID => Some(Self::HOME_POSITION(HOME_POSITION_DATA::default())),
34641 HYGROMETER_SENSOR_DATA::ID => {
34642 Some(Self::HYGROMETER_SENSOR(HYGROMETER_SENSOR_DATA::default()))
34643 }
34644 ILLUMINATOR_STATUS_DATA::ID => {
34645 Some(Self::ILLUMINATOR_STATUS(ILLUMINATOR_STATUS_DATA::default()))
34646 }
34647 ISBD_LINK_STATUS_DATA::ID => {
34648 Some(Self::ISBD_LINK_STATUS(ISBD_LINK_STATUS_DATA::default()))
34649 }
34650 LANDING_TARGET_DATA::ID => Some(Self::LANDING_TARGET(LANDING_TARGET_DATA::default())),
34651 LINK_NODE_STATUS_DATA::ID => {
34652 Some(Self::LINK_NODE_STATUS(LINK_NODE_STATUS_DATA::default()))
34653 }
34654 LOCAL_POSITION_NED_DATA::ID => {
34655 Some(Self::LOCAL_POSITION_NED(LOCAL_POSITION_NED_DATA::default()))
34656 }
34657 LOCAL_POSITION_NED_COV_DATA::ID => Some(Self::LOCAL_POSITION_NED_COV(
34658 LOCAL_POSITION_NED_COV_DATA::default(),
34659 )),
34660 LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA::ID => {
34661 Some(Self::LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET(
34662 LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA::default(),
34663 ))
34664 }
34665 LOGGING_ACK_DATA::ID => Some(Self::LOGGING_ACK(LOGGING_ACK_DATA::default())),
34666 LOGGING_DATA_DATA::ID => Some(Self::LOGGING_DATA(LOGGING_DATA_DATA::default())),
34667 LOGGING_DATA_ACKED_DATA::ID => {
34668 Some(Self::LOGGING_DATA_ACKED(LOGGING_DATA_ACKED_DATA::default()))
34669 }
34670 LOG_DATA_DATA::ID => Some(Self::LOG_DATA(LOG_DATA_DATA::default())),
34671 LOG_ENTRY_DATA::ID => Some(Self::LOG_ENTRY(LOG_ENTRY_DATA::default())),
34672 LOG_ERASE_DATA::ID => Some(Self::LOG_ERASE(LOG_ERASE_DATA::default())),
34673 LOG_REQUEST_DATA_DATA::ID => {
34674 Some(Self::LOG_REQUEST_DATA(LOG_REQUEST_DATA_DATA::default()))
34675 }
34676 LOG_REQUEST_END_DATA::ID => {
34677 Some(Self::LOG_REQUEST_END(LOG_REQUEST_END_DATA::default()))
34678 }
34679 LOG_REQUEST_LIST_DATA::ID => {
34680 Some(Self::LOG_REQUEST_LIST(LOG_REQUEST_LIST_DATA::default()))
34681 }
34682 MAG_CAL_REPORT_DATA::ID => Some(Self::MAG_CAL_REPORT(MAG_CAL_REPORT_DATA::default())),
34683 MANUAL_CONTROL_DATA::ID => Some(Self::MANUAL_CONTROL(MANUAL_CONTROL_DATA::default())),
34684 MANUAL_SETPOINT_DATA::ID => {
34685 Some(Self::MANUAL_SETPOINT(MANUAL_SETPOINT_DATA::default()))
34686 }
34687 MEMORY_VECT_DATA::ID => Some(Self::MEMORY_VECT(MEMORY_VECT_DATA::default())),
34688 MESSAGE_INTERVAL_DATA::ID => {
34689 Some(Self::MESSAGE_INTERVAL(MESSAGE_INTERVAL_DATA::default()))
34690 }
34691 MISSION_ACK_DATA::ID => Some(Self::MISSION_ACK(MISSION_ACK_DATA::default())),
34692 MISSION_CLEAR_ALL_DATA::ID => {
34693 Some(Self::MISSION_CLEAR_ALL(MISSION_CLEAR_ALL_DATA::default()))
34694 }
34695 MISSION_COUNT_DATA::ID => Some(Self::MISSION_COUNT(MISSION_COUNT_DATA::default())),
34696 MISSION_CURRENT_DATA::ID => {
34697 Some(Self::MISSION_CURRENT(MISSION_CURRENT_DATA::default()))
34698 }
34699 MISSION_ITEM_DATA::ID => Some(Self::MISSION_ITEM(MISSION_ITEM_DATA::default())),
34700 MISSION_ITEM_INT_DATA::ID => {
34701 Some(Self::MISSION_ITEM_INT(MISSION_ITEM_INT_DATA::default()))
34702 }
34703 MISSION_ITEM_REACHED_DATA::ID => Some(Self::MISSION_ITEM_REACHED(
34704 MISSION_ITEM_REACHED_DATA::default(),
34705 )),
34706 MISSION_REQUEST_DATA::ID => {
34707 Some(Self::MISSION_REQUEST(MISSION_REQUEST_DATA::default()))
34708 }
34709 MISSION_REQUEST_INT_DATA::ID => Some(Self::MISSION_REQUEST_INT(
34710 MISSION_REQUEST_INT_DATA::default(),
34711 )),
34712 MISSION_REQUEST_LIST_DATA::ID => Some(Self::MISSION_REQUEST_LIST(
34713 MISSION_REQUEST_LIST_DATA::default(),
34714 )),
34715 MISSION_REQUEST_PARTIAL_LIST_DATA::ID => Some(Self::MISSION_REQUEST_PARTIAL_LIST(
34716 MISSION_REQUEST_PARTIAL_LIST_DATA::default(),
34717 )),
34718 MISSION_SET_CURRENT_DATA::ID => Some(Self::MISSION_SET_CURRENT(
34719 MISSION_SET_CURRENT_DATA::default(),
34720 )),
34721 MISSION_WRITE_PARTIAL_LIST_DATA::ID => Some(Self::MISSION_WRITE_PARTIAL_LIST(
34722 MISSION_WRITE_PARTIAL_LIST_DATA::default(),
34723 )),
34724 MOUNT_ORIENTATION_DATA::ID => {
34725 Some(Self::MOUNT_ORIENTATION(MOUNT_ORIENTATION_DATA::default()))
34726 }
34727 NAMED_VALUE_FLOAT_DATA::ID => {
34728 Some(Self::NAMED_VALUE_FLOAT(NAMED_VALUE_FLOAT_DATA::default()))
34729 }
34730 NAMED_VALUE_INT_DATA::ID => {
34731 Some(Self::NAMED_VALUE_INT(NAMED_VALUE_INT_DATA::default()))
34732 }
34733 NAV_CONTROLLER_OUTPUT_DATA::ID => Some(Self::NAV_CONTROLLER_OUTPUT(
34734 NAV_CONTROLLER_OUTPUT_DATA::default(),
34735 )),
34736 OBSTACLE_DISTANCE_DATA::ID => {
34737 Some(Self::OBSTACLE_DISTANCE(OBSTACLE_DISTANCE_DATA::default()))
34738 }
34739 ODOMETRY_DATA::ID => Some(Self::ODOMETRY(ODOMETRY_DATA::default())),
34740 ONBOARD_COMPUTER_STATUS_DATA::ID => Some(Self::ONBOARD_COMPUTER_STATUS(
34741 ONBOARD_COMPUTER_STATUS_DATA::default(),
34742 )),
34743 OPEN_DRONE_ID_ARM_STATUS_DATA::ID => Some(Self::OPEN_DRONE_ID_ARM_STATUS(
34744 OPEN_DRONE_ID_ARM_STATUS_DATA::default(),
34745 )),
34746 OPEN_DRONE_ID_AUTHENTICATION_DATA::ID => Some(Self::OPEN_DRONE_ID_AUTHENTICATION(
34747 OPEN_DRONE_ID_AUTHENTICATION_DATA::default(),
34748 )),
34749 OPEN_DRONE_ID_BASIC_ID_DATA::ID => Some(Self::OPEN_DRONE_ID_BASIC_ID(
34750 OPEN_DRONE_ID_BASIC_ID_DATA::default(),
34751 )),
34752 OPEN_DRONE_ID_LOCATION_DATA::ID => Some(Self::OPEN_DRONE_ID_LOCATION(
34753 OPEN_DRONE_ID_LOCATION_DATA::default(),
34754 )),
34755 OPEN_DRONE_ID_MESSAGE_PACK_DATA::ID => Some(Self::OPEN_DRONE_ID_MESSAGE_PACK(
34756 OPEN_DRONE_ID_MESSAGE_PACK_DATA::default(),
34757 )),
34758 OPEN_DRONE_ID_OPERATOR_ID_DATA::ID => Some(Self::OPEN_DRONE_ID_OPERATOR_ID(
34759 OPEN_DRONE_ID_OPERATOR_ID_DATA::default(),
34760 )),
34761 OPEN_DRONE_ID_SELF_ID_DATA::ID => Some(Self::OPEN_DRONE_ID_SELF_ID(
34762 OPEN_DRONE_ID_SELF_ID_DATA::default(),
34763 )),
34764 OPEN_DRONE_ID_SYSTEM_DATA::ID => Some(Self::OPEN_DRONE_ID_SYSTEM(
34765 OPEN_DRONE_ID_SYSTEM_DATA::default(),
34766 )),
34767 OPEN_DRONE_ID_SYSTEM_UPDATE_DATA::ID => Some(Self::OPEN_DRONE_ID_SYSTEM_UPDATE(
34768 OPEN_DRONE_ID_SYSTEM_UPDATE_DATA::default(),
34769 )),
34770 OPTICAL_FLOW_DATA::ID => Some(Self::OPTICAL_FLOW(OPTICAL_FLOW_DATA::default())),
34771 OPTICAL_FLOW_RAD_DATA::ID => {
34772 Some(Self::OPTICAL_FLOW_RAD(OPTICAL_FLOW_RAD_DATA::default()))
34773 }
34774 ORBIT_EXECUTION_STATUS_DATA::ID => Some(Self::ORBIT_EXECUTION_STATUS(
34775 ORBIT_EXECUTION_STATUS_DATA::default(),
34776 )),
34777 PARAM_EXT_ACK_DATA::ID => Some(Self::PARAM_EXT_ACK(PARAM_EXT_ACK_DATA::default())),
34778 PARAM_EXT_REQUEST_LIST_DATA::ID => Some(Self::PARAM_EXT_REQUEST_LIST(
34779 PARAM_EXT_REQUEST_LIST_DATA::default(),
34780 )),
34781 PARAM_EXT_REQUEST_READ_DATA::ID => Some(Self::PARAM_EXT_REQUEST_READ(
34782 PARAM_EXT_REQUEST_READ_DATA::default(),
34783 )),
34784 PARAM_EXT_SET_DATA::ID => Some(Self::PARAM_EXT_SET(PARAM_EXT_SET_DATA::default())),
34785 PARAM_EXT_VALUE_DATA::ID => {
34786 Some(Self::PARAM_EXT_VALUE(PARAM_EXT_VALUE_DATA::default()))
34787 }
34788 PARAM_MAP_RC_DATA::ID => Some(Self::PARAM_MAP_RC(PARAM_MAP_RC_DATA::default())),
34789 PARAM_REQUEST_LIST_DATA::ID => {
34790 Some(Self::PARAM_REQUEST_LIST(PARAM_REQUEST_LIST_DATA::default()))
34791 }
34792 PARAM_REQUEST_READ_DATA::ID => {
34793 Some(Self::PARAM_REQUEST_READ(PARAM_REQUEST_READ_DATA::default()))
34794 }
34795 PARAM_SET_DATA::ID => Some(Self::PARAM_SET(PARAM_SET_DATA::default())),
34796 PARAM_VALUE_DATA::ID => Some(Self::PARAM_VALUE(PARAM_VALUE_DATA::default())),
34797 PING_DATA::ID => Some(Self::PING(PING_DATA::default())),
34798 PLAY_TUNE_DATA::ID => Some(Self::PLAY_TUNE(PLAY_TUNE_DATA::default())),
34799 PLAY_TUNE_V2_DATA::ID => Some(Self::PLAY_TUNE_V2(PLAY_TUNE_V2_DATA::default())),
34800 POSITION_TARGET_GLOBAL_INT_DATA::ID => Some(Self::POSITION_TARGET_GLOBAL_INT(
34801 POSITION_TARGET_GLOBAL_INT_DATA::default(),
34802 )),
34803 POSITION_TARGET_LOCAL_NED_DATA::ID => Some(Self::POSITION_TARGET_LOCAL_NED(
34804 POSITION_TARGET_LOCAL_NED_DATA::default(),
34805 )),
34806 POWER_STATUS_DATA::ID => Some(Self::POWER_STATUS(POWER_STATUS_DATA::default())),
34807 PROTOCOL_VERSION_DATA::ID => {
34808 Some(Self::PROTOCOL_VERSION(PROTOCOL_VERSION_DATA::default()))
34809 }
34810 RADIO_STATUS_DATA::ID => Some(Self::RADIO_STATUS(RADIO_STATUS_DATA::default())),
34811 RAW_IMU_DATA::ID => Some(Self::RAW_IMU(RAW_IMU_DATA::default())),
34812 RAW_PRESSURE_DATA::ID => Some(Self::RAW_PRESSURE(RAW_PRESSURE_DATA::default())),
34813 RAW_RPM_DATA::ID => Some(Self::RAW_RPM(RAW_RPM_DATA::default())),
34814 RC_CHANNELS_DATA::ID => Some(Self::RC_CHANNELS(RC_CHANNELS_DATA::default())),
34815 RC_CHANNELS_OVERRIDE_DATA::ID => Some(Self::RC_CHANNELS_OVERRIDE(
34816 RC_CHANNELS_OVERRIDE_DATA::default(),
34817 )),
34818 RC_CHANNELS_RAW_DATA::ID => {
34819 Some(Self::RC_CHANNELS_RAW(RC_CHANNELS_RAW_DATA::default()))
34820 }
34821 RC_CHANNELS_SCALED_DATA::ID => {
34822 Some(Self::RC_CHANNELS_SCALED(RC_CHANNELS_SCALED_DATA::default()))
34823 }
34824 REQUEST_DATA_STREAM_DATA::ID => Some(Self::REQUEST_DATA_STREAM(
34825 REQUEST_DATA_STREAM_DATA::default(),
34826 )),
34827 REQUEST_EVENT_DATA::ID => Some(Self::REQUEST_EVENT(REQUEST_EVENT_DATA::default())),
34828 RESOURCE_REQUEST_DATA::ID => {
34829 Some(Self::RESOURCE_REQUEST(RESOURCE_REQUEST_DATA::default()))
34830 }
34831 RESPONSE_EVENT_ERROR_DATA::ID => Some(Self::RESPONSE_EVENT_ERROR(
34832 RESPONSE_EVENT_ERROR_DATA::default(),
34833 )),
34834 SAFETY_ALLOWED_AREA_DATA::ID => Some(Self::SAFETY_ALLOWED_AREA(
34835 SAFETY_ALLOWED_AREA_DATA::default(),
34836 )),
34837 SAFETY_SET_ALLOWED_AREA_DATA::ID => Some(Self::SAFETY_SET_ALLOWED_AREA(
34838 SAFETY_SET_ALLOWED_AREA_DATA::default(),
34839 )),
34840 SCALED_IMU_DATA::ID => Some(Self::SCALED_IMU(SCALED_IMU_DATA::default())),
34841 SCALED_IMU2_DATA::ID => Some(Self::SCALED_IMU2(SCALED_IMU2_DATA::default())),
34842 SCALED_IMU3_DATA::ID => Some(Self::SCALED_IMU3(SCALED_IMU3_DATA::default())),
34843 SCALED_PRESSURE_DATA::ID => {
34844 Some(Self::SCALED_PRESSURE(SCALED_PRESSURE_DATA::default()))
34845 }
34846 SCALED_PRESSURE2_DATA::ID => {
34847 Some(Self::SCALED_PRESSURE2(SCALED_PRESSURE2_DATA::default()))
34848 }
34849 SCALED_PRESSURE3_DATA::ID => {
34850 Some(Self::SCALED_PRESSURE3(SCALED_PRESSURE3_DATA::default()))
34851 }
34852 SERIAL_CONTROL_DATA::ID => Some(Self::SERIAL_CONTROL(SERIAL_CONTROL_DATA::default())),
34853 SERVO_OUTPUT_RAW_DATA::ID => {
34854 Some(Self::SERVO_OUTPUT_RAW(SERVO_OUTPUT_RAW_DATA::default()))
34855 }
34856 SETUP_SIGNING_DATA::ID => Some(Self::SETUP_SIGNING(SETUP_SIGNING_DATA::default())),
34857 SET_ACTUATOR_CONTROL_TARGET_DATA::ID => Some(Self::SET_ACTUATOR_CONTROL_TARGET(
34858 SET_ACTUATOR_CONTROL_TARGET_DATA::default(),
34859 )),
34860 SET_ATTITUDE_TARGET_DATA::ID => Some(Self::SET_ATTITUDE_TARGET(
34861 SET_ATTITUDE_TARGET_DATA::default(),
34862 )),
34863 SET_GPS_GLOBAL_ORIGIN_DATA::ID => Some(Self::SET_GPS_GLOBAL_ORIGIN(
34864 SET_GPS_GLOBAL_ORIGIN_DATA::default(),
34865 )),
34866 SET_HOME_POSITION_DATA::ID => {
34867 Some(Self::SET_HOME_POSITION(SET_HOME_POSITION_DATA::default()))
34868 }
34869 SET_MODE_DATA::ID => Some(Self::SET_MODE(SET_MODE_DATA::default())),
34870 SET_POSITION_TARGET_GLOBAL_INT_DATA::ID => Some(Self::SET_POSITION_TARGET_GLOBAL_INT(
34871 SET_POSITION_TARGET_GLOBAL_INT_DATA::default(),
34872 )),
34873 SET_POSITION_TARGET_LOCAL_NED_DATA::ID => Some(Self::SET_POSITION_TARGET_LOCAL_NED(
34874 SET_POSITION_TARGET_LOCAL_NED_DATA::default(),
34875 )),
34876 SIM_STATE_DATA::ID => Some(Self::SIM_STATE(SIM_STATE_DATA::default())),
34877 SMART_BATTERY_INFO_DATA::ID => {
34878 Some(Self::SMART_BATTERY_INFO(SMART_BATTERY_INFO_DATA::default()))
34879 }
34880 STATUSTEXT_DATA::ID => Some(Self::STATUSTEXT(STATUSTEXT_DATA::default())),
34881 STORAGE_INFORMATION_DATA::ID => Some(Self::STORAGE_INFORMATION(
34882 STORAGE_INFORMATION_DATA::default(),
34883 )),
34884 SUPPORTED_TUNES_DATA::ID => {
34885 Some(Self::SUPPORTED_TUNES(SUPPORTED_TUNES_DATA::default()))
34886 }
34887 SYSTEM_TIME_DATA::ID => Some(Self::SYSTEM_TIME(SYSTEM_TIME_DATA::default())),
34888 SYS_STATUS_DATA::ID => Some(Self::SYS_STATUS(SYS_STATUS_DATA::default())),
34889 TERRAIN_CHECK_DATA::ID => Some(Self::TERRAIN_CHECK(TERRAIN_CHECK_DATA::default())),
34890 TERRAIN_DATA_DATA::ID => Some(Self::TERRAIN_DATA(TERRAIN_DATA_DATA::default())),
34891 TERRAIN_REPORT_DATA::ID => Some(Self::TERRAIN_REPORT(TERRAIN_REPORT_DATA::default())),
34892 TERRAIN_REQUEST_DATA::ID => {
34893 Some(Self::TERRAIN_REQUEST(TERRAIN_REQUEST_DATA::default()))
34894 }
34895 TIMESYNC_DATA::ID => Some(Self::TIMESYNC(TIMESYNC_DATA::default())),
34896 TIME_ESTIMATE_TO_TARGET_DATA::ID => Some(Self::TIME_ESTIMATE_TO_TARGET(
34897 TIME_ESTIMATE_TO_TARGET_DATA::default(),
34898 )),
34899 TRAJECTORY_REPRESENTATION_BEZIER_DATA::ID => {
34900 Some(Self::TRAJECTORY_REPRESENTATION_BEZIER(
34901 TRAJECTORY_REPRESENTATION_BEZIER_DATA::default(),
34902 ))
34903 }
34904 TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA::ID => {
34905 Some(Self::TRAJECTORY_REPRESENTATION_WAYPOINTS(
34906 TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA::default(),
34907 ))
34908 }
34909 TUNNEL_DATA::ID => Some(Self::TUNNEL(TUNNEL_DATA::default())),
34910 UAVCAN_NODE_INFO_DATA::ID => {
34911 Some(Self::UAVCAN_NODE_INFO(UAVCAN_NODE_INFO_DATA::default()))
34912 }
34913 UAVCAN_NODE_STATUS_DATA::ID => {
34914 Some(Self::UAVCAN_NODE_STATUS(UAVCAN_NODE_STATUS_DATA::default()))
34915 }
34916 UTM_GLOBAL_POSITION_DATA::ID => Some(Self::UTM_GLOBAL_POSITION(
34917 UTM_GLOBAL_POSITION_DATA::default(),
34918 )),
34919 V2_EXTENSION_DATA::ID => Some(Self::V2_EXTENSION(V2_EXTENSION_DATA::default())),
34920 VFR_HUD_DATA::ID => Some(Self::VFR_HUD(VFR_HUD_DATA::default())),
34921 VIBRATION_DATA::ID => Some(Self::VIBRATION(VIBRATION_DATA::default())),
34922 VICON_POSITION_ESTIMATE_DATA::ID => Some(Self::VICON_POSITION_ESTIMATE(
34923 VICON_POSITION_ESTIMATE_DATA::default(),
34924 )),
34925 VIDEO_STREAM_INFORMATION_DATA::ID => Some(Self::VIDEO_STREAM_INFORMATION(
34926 VIDEO_STREAM_INFORMATION_DATA::default(),
34927 )),
34928 VIDEO_STREAM_STATUS_DATA::ID => Some(Self::VIDEO_STREAM_STATUS(
34929 VIDEO_STREAM_STATUS_DATA::default(),
34930 )),
34931 VISION_POSITION_ESTIMATE_DATA::ID => Some(Self::VISION_POSITION_ESTIMATE(
34932 VISION_POSITION_ESTIMATE_DATA::default(),
34933 )),
34934 VISION_SPEED_ESTIMATE_DATA::ID => Some(Self::VISION_SPEED_ESTIMATE(
34935 VISION_SPEED_ESTIMATE_DATA::default(),
34936 )),
34937 WHEEL_DISTANCE_DATA::ID => Some(Self::WHEEL_DISTANCE(WHEEL_DISTANCE_DATA::default())),
34938 WIFI_CONFIG_AP_DATA::ID => Some(Self::WIFI_CONFIG_AP(WIFI_CONFIG_AP_DATA::default())),
34939 WINCH_STATUS_DATA::ID => Some(Self::WINCH_STATUS(WINCH_STATUS_DATA::default())),
34940 WIND_COV_DATA::ID => Some(Self::WIND_COV(WIND_COV_DATA::default())),
34941 _ => None,
34942 }
34943 }
34944 #[cfg(feature = "arbitrary")]
34945 fn random_message_from_id<R: rand::RngCore>(id: u32, rng: &mut R) -> Option<Self> {
34946 match id {
34947 ACTUATOR_CONTROL_TARGET_DATA::ID => Some(Self::ACTUATOR_CONTROL_TARGET(
34948 ACTUATOR_CONTROL_TARGET_DATA::random(rng),
34949 )),
34950 ACTUATOR_OUTPUT_STATUS_DATA::ID => Some(Self::ACTUATOR_OUTPUT_STATUS(
34951 ACTUATOR_OUTPUT_STATUS_DATA::random(rng),
34952 )),
34953 ADSB_VEHICLE_DATA::ID => Some(Self::ADSB_VEHICLE(ADSB_VEHICLE_DATA::random(rng))),
34954 AIS_VESSEL_DATA::ID => Some(Self::AIS_VESSEL(AIS_VESSEL_DATA::random(rng))),
34955 ALTITUDE_DATA::ID => Some(Self::ALTITUDE(ALTITUDE_DATA::random(rng))),
34956 ATTITUDE_DATA::ID => Some(Self::ATTITUDE(ATTITUDE_DATA::random(rng))),
34957 ATTITUDE_QUATERNION_DATA::ID => Some(Self::ATTITUDE_QUATERNION(
34958 ATTITUDE_QUATERNION_DATA::random(rng),
34959 )),
34960 ATTITUDE_QUATERNION_COV_DATA::ID => Some(Self::ATTITUDE_QUATERNION_COV(
34961 ATTITUDE_QUATERNION_COV_DATA::random(rng),
34962 )),
34963 ATTITUDE_TARGET_DATA::ID => {
34964 Some(Self::ATTITUDE_TARGET(ATTITUDE_TARGET_DATA::random(rng)))
34965 }
34966 ATT_POS_MOCAP_DATA::ID => Some(Self::ATT_POS_MOCAP(ATT_POS_MOCAP_DATA::random(rng))),
34967 AUTH_KEY_DATA::ID => Some(Self::AUTH_KEY(AUTH_KEY_DATA::random(rng))),
34968 AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA::ID => {
34969 Some(Self::AUTOPILOT_STATE_FOR_GIMBAL_DEVICE(
34970 AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA::random(rng),
34971 ))
34972 }
34973 AUTOPILOT_VERSION_DATA::ID => {
34974 Some(Self::AUTOPILOT_VERSION(AUTOPILOT_VERSION_DATA::random(rng)))
34975 }
34976 AVAILABLE_MODES_DATA::ID => {
34977 Some(Self::AVAILABLE_MODES(AVAILABLE_MODES_DATA::random(rng)))
34978 }
34979 AVAILABLE_MODES_MONITOR_DATA::ID => Some(Self::AVAILABLE_MODES_MONITOR(
34980 AVAILABLE_MODES_MONITOR_DATA::random(rng),
34981 )),
34982 BATTERY_INFO_DATA::ID => Some(Self::BATTERY_INFO(BATTERY_INFO_DATA::random(rng))),
34983 BATTERY_STATUS_DATA::ID => Some(Self::BATTERY_STATUS(BATTERY_STATUS_DATA::random(rng))),
34984 BUTTON_CHANGE_DATA::ID => Some(Self::BUTTON_CHANGE(BUTTON_CHANGE_DATA::random(rng))),
34985 CAMERA_CAPTURE_STATUS_DATA::ID => Some(Self::CAMERA_CAPTURE_STATUS(
34986 CAMERA_CAPTURE_STATUS_DATA::random(rng),
34987 )),
34988 CAMERA_FOV_STATUS_DATA::ID => {
34989 Some(Self::CAMERA_FOV_STATUS(CAMERA_FOV_STATUS_DATA::random(rng)))
34990 }
34991 CAMERA_IMAGE_CAPTURED_DATA::ID => Some(Self::CAMERA_IMAGE_CAPTURED(
34992 CAMERA_IMAGE_CAPTURED_DATA::random(rng),
34993 )),
34994 CAMERA_INFORMATION_DATA::ID => Some(Self::CAMERA_INFORMATION(
34995 CAMERA_INFORMATION_DATA::random(rng),
34996 )),
34997 CAMERA_SETTINGS_DATA::ID => {
34998 Some(Self::CAMERA_SETTINGS(CAMERA_SETTINGS_DATA::random(rng)))
34999 }
35000 CAMERA_THERMAL_RANGE_DATA::ID => Some(Self::CAMERA_THERMAL_RANGE(
35001 CAMERA_THERMAL_RANGE_DATA::random(rng),
35002 )),
35003 CAMERA_TRACKING_GEO_STATUS_DATA::ID => Some(Self::CAMERA_TRACKING_GEO_STATUS(
35004 CAMERA_TRACKING_GEO_STATUS_DATA::random(rng),
35005 )),
35006 CAMERA_TRACKING_IMAGE_STATUS_DATA::ID => Some(Self::CAMERA_TRACKING_IMAGE_STATUS(
35007 CAMERA_TRACKING_IMAGE_STATUS_DATA::random(rng),
35008 )),
35009 CAMERA_TRIGGER_DATA::ID => Some(Self::CAMERA_TRIGGER(CAMERA_TRIGGER_DATA::random(rng))),
35010 CANFD_FRAME_DATA::ID => Some(Self::CANFD_FRAME(CANFD_FRAME_DATA::random(rng))),
35011 CAN_FILTER_MODIFY_DATA::ID => {
35012 Some(Self::CAN_FILTER_MODIFY(CAN_FILTER_MODIFY_DATA::random(rng)))
35013 }
35014 CAN_FRAME_DATA::ID => Some(Self::CAN_FRAME(CAN_FRAME_DATA::random(rng))),
35015 CELLULAR_CONFIG_DATA::ID => {
35016 Some(Self::CELLULAR_CONFIG(CELLULAR_CONFIG_DATA::random(rng)))
35017 }
35018 CELLULAR_STATUS_DATA::ID => {
35019 Some(Self::CELLULAR_STATUS(CELLULAR_STATUS_DATA::random(rng)))
35020 }
35021 CHANGE_OPERATOR_CONTROL_DATA::ID => Some(Self::CHANGE_OPERATOR_CONTROL(
35022 CHANGE_OPERATOR_CONTROL_DATA::random(rng),
35023 )),
35024 CHANGE_OPERATOR_CONTROL_ACK_DATA::ID => Some(Self::CHANGE_OPERATOR_CONTROL_ACK(
35025 CHANGE_OPERATOR_CONTROL_ACK_DATA::random(rng),
35026 )),
35027 COLLISION_DATA::ID => Some(Self::COLLISION(COLLISION_DATA::random(rng))),
35028 COMMAND_ACK_DATA::ID => Some(Self::COMMAND_ACK(COMMAND_ACK_DATA::random(rng))),
35029 COMMAND_CANCEL_DATA::ID => Some(Self::COMMAND_CANCEL(COMMAND_CANCEL_DATA::random(rng))),
35030 COMMAND_INT_DATA::ID => Some(Self::COMMAND_INT(COMMAND_INT_DATA::random(rng))),
35031 COMMAND_LONG_DATA::ID => Some(Self::COMMAND_LONG(COMMAND_LONG_DATA::random(rng))),
35032 COMPONENT_INFORMATION_DATA::ID => Some(Self::COMPONENT_INFORMATION(
35033 COMPONENT_INFORMATION_DATA::random(rng),
35034 )),
35035 COMPONENT_INFORMATION_BASIC_DATA::ID => Some(Self::COMPONENT_INFORMATION_BASIC(
35036 COMPONENT_INFORMATION_BASIC_DATA::random(rng),
35037 )),
35038 COMPONENT_METADATA_DATA::ID => Some(Self::COMPONENT_METADATA(
35039 COMPONENT_METADATA_DATA::random(rng),
35040 )),
35041 CONTROL_SYSTEM_STATE_DATA::ID => Some(Self::CONTROL_SYSTEM_STATE(
35042 CONTROL_SYSTEM_STATE_DATA::random(rng),
35043 )),
35044 CURRENT_EVENT_SEQUENCE_DATA::ID => Some(Self::CURRENT_EVENT_SEQUENCE(
35045 CURRENT_EVENT_SEQUENCE_DATA::random(rng),
35046 )),
35047 CURRENT_MODE_DATA::ID => Some(Self::CURRENT_MODE(CURRENT_MODE_DATA::random(rng))),
35048 DATA_STREAM_DATA::ID => Some(Self::DATA_STREAM(DATA_STREAM_DATA::random(rng))),
35049 DATA_TRANSMISSION_HANDSHAKE_DATA::ID => Some(Self::DATA_TRANSMISSION_HANDSHAKE(
35050 DATA_TRANSMISSION_HANDSHAKE_DATA::random(rng),
35051 )),
35052 DEBUG_DATA::ID => Some(Self::DEBUG(DEBUG_DATA::random(rng))),
35053 DEBUG_FLOAT_ARRAY_DATA::ID => {
35054 Some(Self::DEBUG_FLOAT_ARRAY(DEBUG_FLOAT_ARRAY_DATA::random(rng)))
35055 }
35056 DEBUG_VECT_DATA::ID => Some(Self::DEBUG_VECT(DEBUG_VECT_DATA::random(rng))),
35057 DISTANCE_SENSOR_DATA::ID => {
35058 Some(Self::DISTANCE_SENSOR(DISTANCE_SENSOR_DATA::random(rng)))
35059 }
35060 EFI_STATUS_DATA::ID => Some(Self::EFI_STATUS(EFI_STATUS_DATA::random(rng))),
35061 ENCAPSULATED_DATA_DATA::ID => {
35062 Some(Self::ENCAPSULATED_DATA(ENCAPSULATED_DATA_DATA::random(rng)))
35063 }
35064 ESC_INFO_DATA::ID => Some(Self::ESC_INFO(ESC_INFO_DATA::random(rng))),
35065 ESC_STATUS_DATA::ID => Some(Self::ESC_STATUS(ESC_STATUS_DATA::random(rng))),
35066 ESTIMATOR_STATUS_DATA::ID => {
35067 Some(Self::ESTIMATOR_STATUS(ESTIMATOR_STATUS_DATA::random(rng)))
35068 }
35069 EVENT_DATA::ID => Some(Self::EVENT(EVENT_DATA::random(rng))),
35070 EXTENDED_SYS_STATE_DATA::ID => Some(Self::EXTENDED_SYS_STATE(
35071 EXTENDED_SYS_STATE_DATA::random(rng),
35072 )),
35073 FENCE_STATUS_DATA::ID => Some(Self::FENCE_STATUS(FENCE_STATUS_DATA::random(rng))),
35074 FILE_TRANSFER_PROTOCOL_DATA::ID => Some(Self::FILE_TRANSFER_PROTOCOL(
35075 FILE_TRANSFER_PROTOCOL_DATA::random(rng),
35076 )),
35077 FLIGHT_INFORMATION_DATA::ID => Some(Self::FLIGHT_INFORMATION(
35078 FLIGHT_INFORMATION_DATA::random(rng),
35079 )),
35080 FOLLOW_TARGET_DATA::ID => Some(Self::FOLLOW_TARGET(FOLLOW_TARGET_DATA::random(rng))),
35081 FUEL_STATUS_DATA::ID => Some(Self::FUEL_STATUS(FUEL_STATUS_DATA::random(rng))),
35082 GENERATOR_STATUS_DATA::ID => {
35083 Some(Self::GENERATOR_STATUS(GENERATOR_STATUS_DATA::random(rng)))
35084 }
35085 GIMBAL_DEVICE_ATTITUDE_STATUS_DATA::ID => Some(Self::GIMBAL_DEVICE_ATTITUDE_STATUS(
35086 GIMBAL_DEVICE_ATTITUDE_STATUS_DATA::random(rng),
35087 )),
35088 GIMBAL_DEVICE_INFORMATION_DATA::ID => Some(Self::GIMBAL_DEVICE_INFORMATION(
35089 GIMBAL_DEVICE_INFORMATION_DATA::random(rng),
35090 )),
35091 GIMBAL_DEVICE_SET_ATTITUDE_DATA::ID => Some(Self::GIMBAL_DEVICE_SET_ATTITUDE(
35092 GIMBAL_DEVICE_SET_ATTITUDE_DATA::random(rng),
35093 )),
35094 GIMBAL_MANAGER_INFORMATION_DATA::ID => Some(Self::GIMBAL_MANAGER_INFORMATION(
35095 GIMBAL_MANAGER_INFORMATION_DATA::random(rng),
35096 )),
35097 GIMBAL_MANAGER_SET_ATTITUDE_DATA::ID => Some(Self::GIMBAL_MANAGER_SET_ATTITUDE(
35098 GIMBAL_MANAGER_SET_ATTITUDE_DATA::random(rng),
35099 )),
35100 GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA::ID => {
35101 Some(Self::GIMBAL_MANAGER_SET_MANUAL_CONTROL(
35102 GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA::random(rng),
35103 ))
35104 }
35105 GIMBAL_MANAGER_SET_PITCHYAW_DATA::ID => Some(Self::GIMBAL_MANAGER_SET_PITCHYAW(
35106 GIMBAL_MANAGER_SET_PITCHYAW_DATA::random(rng),
35107 )),
35108 GIMBAL_MANAGER_STATUS_DATA::ID => Some(Self::GIMBAL_MANAGER_STATUS(
35109 GIMBAL_MANAGER_STATUS_DATA::random(rng),
35110 )),
35111 GLOBAL_POSITION_INT_DATA::ID => Some(Self::GLOBAL_POSITION_INT(
35112 GLOBAL_POSITION_INT_DATA::random(rng),
35113 )),
35114 GLOBAL_POSITION_INT_COV_DATA::ID => Some(Self::GLOBAL_POSITION_INT_COV(
35115 GLOBAL_POSITION_INT_COV_DATA::random(rng),
35116 )),
35117 GLOBAL_VISION_POSITION_ESTIMATE_DATA::ID => {
35118 Some(Self::GLOBAL_VISION_POSITION_ESTIMATE(
35119 GLOBAL_VISION_POSITION_ESTIMATE_DATA::random(rng),
35120 ))
35121 }
35122 GPS2_RAW_DATA::ID => Some(Self::GPS2_RAW(GPS2_RAW_DATA::random(rng))),
35123 GPS2_RTK_DATA::ID => Some(Self::GPS2_RTK(GPS2_RTK_DATA::random(rng))),
35124 GPS_GLOBAL_ORIGIN_DATA::ID => {
35125 Some(Self::GPS_GLOBAL_ORIGIN(GPS_GLOBAL_ORIGIN_DATA::random(rng)))
35126 }
35127 GPS_INJECT_DATA_DATA::ID => {
35128 Some(Self::GPS_INJECT_DATA(GPS_INJECT_DATA_DATA::random(rng)))
35129 }
35130 GPS_INPUT_DATA::ID => Some(Self::GPS_INPUT(GPS_INPUT_DATA::random(rng))),
35131 GPS_RAW_INT_DATA::ID => Some(Self::GPS_RAW_INT(GPS_RAW_INT_DATA::random(rng))),
35132 GPS_RTCM_DATA_DATA::ID => Some(Self::GPS_RTCM_DATA(GPS_RTCM_DATA_DATA::random(rng))),
35133 GPS_RTK_DATA::ID => Some(Self::GPS_RTK(GPS_RTK_DATA::random(rng))),
35134 GPS_STATUS_DATA::ID => Some(Self::GPS_STATUS(GPS_STATUS_DATA::random(rng))),
35135 HEARTBEAT_DATA::ID => Some(Self::HEARTBEAT(HEARTBEAT_DATA::random(rng))),
35136 HIGHRES_IMU_DATA::ID => Some(Self::HIGHRES_IMU(HIGHRES_IMU_DATA::random(rng))),
35137 HIGH_LATENCY_DATA::ID => Some(Self::HIGH_LATENCY(HIGH_LATENCY_DATA::random(rng))),
35138 HIGH_LATENCY2_DATA::ID => Some(Self::HIGH_LATENCY2(HIGH_LATENCY2_DATA::random(rng))),
35139 HIL_ACTUATOR_CONTROLS_DATA::ID => Some(Self::HIL_ACTUATOR_CONTROLS(
35140 HIL_ACTUATOR_CONTROLS_DATA::random(rng),
35141 )),
35142 HIL_CONTROLS_DATA::ID => Some(Self::HIL_CONTROLS(HIL_CONTROLS_DATA::random(rng))),
35143 HIL_GPS_DATA::ID => Some(Self::HIL_GPS(HIL_GPS_DATA::random(rng))),
35144 HIL_OPTICAL_FLOW_DATA::ID => {
35145 Some(Self::HIL_OPTICAL_FLOW(HIL_OPTICAL_FLOW_DATA::random(rng)))
35146 }
35147 HIL_RC_INPUTS_RAW_DATA::ID => {
35148 Some(Self::HIL_RC_INPUTS_RAW(HIL_RC_INPUTS_RAW_DATA::random(rng)))
35149 }
35150 HIL_SENSOR_DATA::ID => Some(Self::HIL_SENSOR(HIL_SENSOR_DATA::random(rng))),
35151 HIL_STATE_DATA::ID => Some(Self::HIL_STATE(HIL_STATE_DATA::random(rng))),
35152 HIL_STATE_QUATERNION_DATA::ID => Some(Self::HIL_STATE_QUATERNION(
35153 HIL_STATE_QUATERNION_DATA::random(rng),
35154 )),
35155 HOME_POSITION_DATA::ID => Some(Self::HOME_POSITION(HOME_POSITION_DATA::random(rng))),
35156 HYGROMETER_SENSOR_DATA::ID => {
35157 Some(Self::HYGROMETER_SENSOR(HYGROMETER_SENSOR_DATA::random(rng)))
35158 }
35159 ILLUMINATOR_STATUS_DATA::ID => Some(Self::ILLUMINATOR_STATUS(
35160 ILLUMINATOR_STATUS_DATA::random(rng),
35161 )),
35162 ISBD_LINK_STATUS_DATA::ID => {
35163 Some(Self::ISBD_LINK_STATUS(ISBD_LINK_STATUS_DATA::random(rng)))
35164 }
35165 LANDING_TARGET_DATA::ID => Some(Self::LANDING_TARGET(LANDING_TARGET_DATA::random(rng))),
35166 LINK_NODE_STATUS_DATA::ID => {
35167 Some(Self::LINK_NODE_STATUS(LINK_NODE_STATUS_DATA::random(rng)))
35168 }
35169 LOCAL_POSITION_NED_DATA::ID => Some(Self::LOCAL_POSITION_NED(
35170 LOCAL_POSITION_NED_DATA::random(rng),
35171 )),
35172 LOCAL_POSITION_NED_COV_DATA::ID => Some(Self::LOCAL_POSITION_NED_COV(
35173 LOCAL_POSITION_NED_COV_DATA::random(rng),
35174 )),
35175 LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA::ID => {
35176 Some(Self::LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET(
35177 LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA::random(rng),
35178 ))
35179 }
35180 LOGGING_ACK_DATA::ID => Some(Self::LOGGING_ACK(LOGGING_ACK_DATA::random(rng))),
35181 LOGGING_DATA_DATA::ID => Some(Self::LOGGING_DATA(LOGGING_DATA_DATA::random(rng))),
35182 LOGGING_DATA_ACKED_DATA::ID => Some(Self::LOGGING_DATA_ACKED(
35183 LOGGING_DATA_ACKED_DATA::random(rng),
35184 )),
35185 LOG_DATA_DATA::ID => Some(Self::LOG_DATA(LOG_DATA_DATA::random(rng))),
35186 LOG_ENTRY_DATA::ID => Some(Self::LOG_ENTRY(LOG_ENTRY_DATA::random(rng))),
35187 LOG_ERASE_DATA::ID => Some(Self::LOG_ERASE(LOG_ERASE_DATA::random(rng))),
35188 LOG_REQUEST_DATA_DATA::ID => {
35189 Some(Self::LOG_REQUEST_DATA(LOG_REQUEST_DATA_DATA::random(rng)))
35190 }
35191 LOG_REQUEST_END_DATA::ID => {
35192 Some(Self::LOG_REQUEST_END(LOG_REQUEST_END_DATA::random(rng)))
35193 }
35194 LOG_REQUEST_LIST_DATA::ID => {
35195 Some(Self::LOG_REQUEST_LIST(LOG_REQUEST_LIST_DATA::random(rng)))
35196 }
35197 MAG_CAL_REPORT_DATA::ID => Some(Self::MAG_CAL_REPORT(MAG_CAL_REPORT_DATA::random(rng))),
35198 MANUAL_CONTROL_DATA::ID => Some(Self::MANUAL_CONTROL(MANUAL_CONTROL_DATA::random(rng))),
35199 MANUAL_SETPOINT_DATA::ID => {
35200 Some(Self::MANUAL_SETPOINT(MANUAL_SETPOINT_DATA::random(rng)))
35201 }
35202 MEMORY_VECT_DATA::ID => Some(Self::MEMORY_VECT(MEMORY_VECT_DATA::random(rng))),
35203 MESSAGE_INTERVAL_DATA::ID => {
35204 Some(Self::MESSAGE_INTERVAL(MESSAGE_INTERVAL_DATA::random(rng)))
35205 }
35206 MISSION_ACK_DATA::ID => Some(Self::MISSION_ACK(MISSION_ACK_DATA::random(rng))),
35207 MISSION_CLEAR_ALL_DATA::ID => {
35208 Some(Self::MISSION_CLEAR_ALL(MISSION_CLEAR_ALL_DATA::random(rng)))
35209 }
35210 MISSION_COUNT_DATA::ID => Some(Self::MISSION_COUNT(MISSION_COUNT_DATA::random(rng))),
35211 MISSION_CURRENT_DATA::ID => {
35212 Some(Self::MISSION_CURRENT(MISSION_CURRENT_DATA::random(rng)))
35213 }
35214 MISSION_ITEM_DATA::ID => Some(Self::MISSION_ITEM(MISSION_ITEM_DATA::random(rng))),
35215 MISSION_ITEM_INT_DATA::ID => {
35216 Some(Self::MISSION_ITEM_INT(MISSION_ITEM_INT_DATA::random(rng)))
35217 }
35218 MISSION_ITEM_REACHED_DATA::ID => Some(Self::MISSION_ITEM_REACHED(
35219 MISSION_ITEM_REACHED_DATA::random(rng),
35220 )),
35221 MISSION_REQUEST_DATA::ID => {
35222 Some(Self::MISSION_REQUEST(MISSION_REQUEST_DATA::random(rng)))
35223 }
35224 MISSION_REQUEST_INT_DATA::ID => Some(Self::MISSION_REQUEST_INT(
35225 MISSION_REQUEST_INT_DATA::random(rng),
35226 )),
35227 MISSION_REQUEST_LIST_DATA::ID => Some(Self::MISSION_REQUEST_LIST(
35228 MISSION_REQUEST_LIST_DATA::random(rng),
35229 )),
35230 MISSION_REQUEST_PARTIAL_LIST_DATA::ID => Some(Self::MISSION_REQUEST_PARTIAL_LIST(
35231 MISSION_REQUEST_PARTIAL_LIST_DATA::random(rng),
35232 )),
35233 MISSION_SET_CURRENT_DATA::ID => Some(Self::MISSION_SET_CURRENT(
35234 MISSION_SET_CURRENT_DATA::random(rng),
35235 )),
35236 MISSION_WRITE_PARTIAL_LIST_DATA::ID => Some(Self::MISSION_WRITE_PARTIAL_LIST(
35237 MISSION_WRITE_PARTIAL_LIST_DATA::random(rng),
35238 )),
35239 MOUNT_ORIENTATION_DATA::ID => {
35240 Some(Self::MOUNT_ORIENTATION(MOUNT_ORIENTATION_DATA::random(rng)))
35241 }
35242 NAMED_VALUE_FLOAT_DATA::ID => {
35243 Some(Self::NAMED_VALUE_FLOAT(NAMED_VALUE_FLOAT_DATA::random(rng)))
35244 }
35245 NAMED_VALUE_INT_DATA::ID => {
35246 Some(Self::NAMED_VALUE_INT(NAMED_VALUE_INT_DATA::random(rng)))
35247 }
35248 NAV_CONTROLLER_OUTPUT_DATA::ID => Some(Self::NAV_CONTROLLER_OUTPUT(
35249 NAV_CONTROLLER_OUTPUT_DATA::random(rng),
35250 )),
35251 OBSTACLE_DISTANCE_DATA::ID => {
35252 Some(Self::OBSTACLE_DISTANCE(OBSTACLE_DISTANCE_DATA::random(rng)))
35253 }
35254 ODOMETRY_DATA::ID => Some(Self::ODOMETRY(ODOMETRY_DATA::random(rng))),
35255 ONBOARD_COMPUTER_STATUS_DATA::ID => Some(Self::ONBOARD_COMPUTER_STATUS(
35256 ONBOARD_COMPUTER_STATUS_DATA::random(rng),
35257 )),
35258 OPEN_DRONE_ID_ARM_STATUS_DATA::ID => Some(Self::OPEN_DRONE_ID_ARM_STATUS(
35259 OPEN_DRONE_ID_ARM_STATUS_DATA::random(rng),
35260 )),
35261 OPEN_DRONE_ID_AUTHENTICATION_DATA::ID => Some(Self::OPEN_DRONE_ID_AUTHENTICATION(
35262 OPEN_DRONE_ID_AUTHENTICATION_DATA::random(rng),
35263 )),
35264 OPEN_DRONE_ID_BASIC_ID_DATA::ID => Some(Self::OPEN_DRONE_ID_BASIC_ID(
35265 OPEN_DRONE_ID_BASIC_ID_DATA::random(rng),
35266 )),
35267 OPEN_DRONE_ID_LOCATION_DATA::ID => Some(Self::OPEN_DRONE_ID_LOCATION(
35268 OPEN_DRONE_ID_LOCATION_DATA::random(rng),
35269 )),
35270 OPEN_DRONE_ID_MESSAGE_PACK_DATA::ID => Some(Self::OPEN_DRONE_ID_MESSAGE_PACK(
35271 OPEN_DRONE_ID_MESSAGE_PACK_DATA::random(rng),
35272 )),
35273 OPEN_DRONE_ID_OPERATOR_ID_DATA::ID => Some(Self::OPEN_DRONE_ID_OPERATOR_ID(
35274 OPEN_DRONE_ID_OPERATOR_ID_DATA::random(rng),
35275 )),
35276 OPEN_DRONE_ID_SELF_ID_DATA::ID => Some(Self::OPEN_DRONE_ID_SELF_ID(
35277 OPEN_DRONE_ID_SELF_ID_DATA::random(rng),
35278 )),
35279 OPEN_DRONE_ID_SYSTEM_DATA::ID => Some(Self::OPEN_DRONE_ID_SYSTEM(
35280 OPEN_DRONE_ID_SYSTEM_DATA::random(rng),
35281 )),
35282 OPEN_DRONE_ID_SYSTEM_UPDATE_DATA::ID => Some(Self::OPEN_DRONE_ID_SYSTEM_UPDATE(
35283 OPEN_DRONE_ID_SYSTEM_UPDATE_DATA::random(rng),
35284 )),
35285 OPTICAL_FLOW_DATA::ID => Some(Self::OPTICAL_FLOW(OPTICAL_FLOW_DATA::random(rng))),
35286 OPTICAL_FLOW_RAD_DATA::ID => {
35287 Some(Self::OPTICAL_FLOW_RAD(OPTICAL_FLOW_RAD_DATA::random(rng)))
35288 }
35289 ORBIT_EXECUTION_STATUS_DATA::ID => Some(Self::ORBIT_EXECUTION_STATUS(
35290 ORBIT_EXECUTION_STATUS_DATA::random(rng),
35291 )),
35292 PARAM_EXT_ACK_DATA::ID => Some(Self::PARAM_EXT_ACK(PARAM_EXT_ACK_DATA::random(rng))),
35293 PARAM_EXT_REQUEST_LIST_DATA::ID => Some(Self::PARAM_EXT_REQUEST_LIST(
35294 PARAM_EXT_REQUEST_LIST_DATA::random(rng),
35295 )),
35296 PARAM_EXT_REQUEST_READ_DATA::ID => Some(Self::PARAM_EXT_REQUEST_READ(
35297 PARAM_EXT_REQUEST_READ_DATA::random(rng),
35298 )),
35299 PARAM_EXT_SET_DATA::ID => Some(Self::PARAM_EXT_SET(PARAM_EXT_SET_DATA::random(rng))),
35300 PARAM_EXT_VALUE_DATA::ID => {
35301 Some(Self::PARAM_EXT_VALUE(PARAM_EXT_VALUE_DATA::random(rng)))
35302 }
35303 PARAM_MAP_RC_DATA::ID => Some(Self::PARAM_MAP_RC(PARAM_MAP_RC_DATA::random(rng))),
35304 PARAM_REQUEST_LIST_DATA::ID => Some(Self::PARAM_REQUEST_LIST(
35305 PARAM_REQUEST_LIST_DATA::random(rng),
35306 )),
35307 PARAM_REQUEST_READ_DATA::ID => Some(Self::PARAM_REQUEST_READ(
35308 PARAM_REQUEST_READ_DATA::random(rng),
35309 )),
35310 PARAM_SET_DATA::ID => Some(Self::PARAM_SET(PARAM_SET_DATA::random(rng))),
35311 PARAM_VALUE_DATA::ID => Some(Self::PARAM_VALUE(PARAM_VALUE_DATA::random(rng))),
35312 PING_DATA::ID => Some(Self::PING(PING_DATA::random(rng))),
35313 PLAY_TUNE_DATA::ID => Some(Self::PLAY_TUNE(PLAY_TUNE_DATA::random(rng))),
35314 PLAY_TUNE_V2_DATA::ID => Some(Self::PLAY_TUNE_V2(PLAY_TUNE_V2_DATA::random(rng))),
35315 POSITION_TARGET_GLOBAL_INT_DATA::ID => Some(Self::POSITION_TARGET_GLOBAL_INT(
35316 POSITION_TARGET_GLOBAL_INT_DATA::random(rng),
35317 )),
35318 POSITION_TARGET_LOCAL_NED_DATA::ID => Some(Self::POSITION_TARGET_LOCAL_NED(
35319 POSITION_TARGET_LOCAL_NED_DATA::random(rng),
35320 )),
35321 POWER_STATUS_DATA::ID => Some(Self::POWER_STATUS(POWER_STATUS_DATA::random(rng))),
35322 PROTOCOL_VERSION_DATA::ID => {
35323 Some(Self::PROTOCOL_VERSION(PROTOCOL_VERSION_DATA::random(rng)))
35324 }
35325 RADIO_STATUS_DATA::ID => Some(Self::RADIO_STATUS(RADIO_STATUS_DATA::random(rng))),
35326 RAW_IMU_DATA::ID => Some(Self::RAW_IMU(RAW_IMU_DATA::random(rng))),
35327 RAW_PRESSURE_DATA::ID => Some(Self::RAW_PRESSURE(RAW_PRESSURE_DATA::random(rng))),
35328 RAW_RPM_DATA::ID => Some(Self::RAW_RPM(RAW_RPM_DATA::random(rng))),
35329 RC_CHANNELS_DATA::ID => Some(Self::RC_CHANNELS(RC_CHANNELS_DATA::random(rng))),
35330 RC_CHANNELS_OVERRIDE_DATA::ID => Some(Self::RC_CHANNELS_OVERRIDE(
35331 RC_CHANNELS_OVERRIDE_DATA::random(rng),
35332 )),
35333 RC_CHANNELS_RAW_DATA::ID => {
35334 Some(Self::RC_CHANNELS_RAW(RC_CHANNELS_RAW_DATA::random(rng)))
35335 }
35336 RC_CHANNELS_SCALED_DATA::ID => Some(Self::RC_CHANNELS_SCALED(
35337 RC_CHANNELS_SCALED_DATA::random(rng),
35338 )),
35339 REQUEST_DATA_STREAM_DATA::ID => Some(Self::REQUEST_DATA_STREAM(
35340 REQUEST_DATA_STREAM_DATA::random(rng),
35341 )),
35342 REQUEST_EVENT_DATA::ID => Some(Self::REQUEST_EVENT(REQUEST_EVENT_DATA::random(rng))),
35343 RESOURCE_REQUEST_DATA::ID => {
35344 Some(Self::RESOURCE_REQUEST(RESOURCE_REQUEST_DATA::random(rng)))
35345 }
35346 RESPONSE_EVENT_ERROR_DATA::ID => Some(Self::RESPONSE_EVENT_ERROR(
35347 RESPONSE_EVENT_ERROR_DATA::random(rng),
35348 )),
35349 SAFETY_ALLOWED_AREA_DATA::ID => Some(Self::SAFETY_ALLOWED_AREA(
35350 SAFETY_ALLOWED_AREA_DATA::random(rng),
35351 )),
35352 SAFETY_SET_ALLOWED_AREA_DATA::ID => Some(Self::SAFETY_SET_ALLOWED_AREA(
35353 SAFETY_SET_ALLOWED_AREA_DATA::random(rng),
35354 )),
35355 SCALED_IMU_DATA::ID => Some(Self::SCALED_IMU(SCALED_IMU_DATA::random(rng))),
35356 SCALED_IMU2_DATA::ID => Some(Self::SCALED_IMU2(SCALED_IMU2_DATA::random(rng))),
35357 SCALED_IMU3_DATA::ID => Some(Self::SCALED_IMU3(SCALED_IMU3_DATA::random(rng))),
35358 SCALED_PRESSURE_DATA::ID => {
35359 Some(Self::SCALED_PRESSURE(SCALED_PRESSURE_DATA::random(rng)))
35360 }
35361 SCALED_PRESSURE2_DATA::ID => {
35362 Some(Self::SCALED_PRESSURE2(SCALED_PRESSURE2_DATA::random(rng)))
35363 }
35364 SCALED_PRESSURE3_DATA::ID => {
35365 Some(Self::SCALED_PRESSURE3(SCALED_PRESSURE3_DATA::random(rng)))
35366 }
35367 SERIAL_CONTROL_DATA::ID => Some(Self::SERIAL_CONTROL(SERIAL_CONTROL_DATA::random(rng))),
35368 SERVO_OUTPUT_RAW_DATA::ID => {
35369 Some(Self::SERVO_OUTPUT_RAW(SERVO_OUTPUT_RAW_DATA::random(rng)))
35370 }
35371 SETUP_SIGNING_DATA::ID => Some(Self::SETUP_SIGNING(SETUP_SIGNING_DATA::random(rng))),
35372 SET_ACTUATOR_CONTROL_TARGET_DATA::ID => Some(Self::SET_ACTUATOR_CONTROL_TARGET(
35373 SET_ACTUATOR_CONTROL_TARGET_DATA::random(rng),
35374 )),
35375 SET_ATTITUDE_TARGET_DATA::ID => Some(Self::SET_ATTITUDE_TARGET(
35376 SET_ATTITUDE_TARGET_DATA::random(rng),
35377 )),
35378 SET_GPS_GLOBAL_ORIGIN_DATA::ID => Some(Self::SET_GPS_GLOBAL_ORIGIN(
35379 SET_GPS_GLOBAL_ORIGIN_DATA::random(rng),
35380 )),
35381 SET_HOME_POSITION_DATA::ID => {
35382 Some(Self::SET_HOME_POSITION(SET_HOME_POSITION_DATA::random(rng)))
35383 }
35384 SET_MODE_DATA::ID => Some(Self::SET_MODE(SET_MODE_DATA::random(rng))),
35385 SET_POSITION_TARGET_GLOBAL_INT_DATA::ID => Some(Self::SET_POSITION_TARGET_GLOBAL_INT(
35386 SET_POSITION_TARGET_GLOBAL_INT_DATA::random(rng),
35387 )),
35388 SET_POSITION_TARGET_LOCAL_NED_DATA::ID => Some(Self::SET_POSITION_TARGET_LOCAL_NED(
35389 SET_POSITION_TARGET_LOCAL_NED_DATA::random(rng),
35390 )),
35391 SIM_STATE_DATA::ID => Some(Self::SIM_STATE(SIM_STATE_DATA::random(rng))),
35392 SMART_BATTERY_INFO_DATA::ID => Some(Self::SMART_BATTERY_INFO(
35393 SMART_BATTERY_INFO_DATA::random(rng),
35394 )),
35395 STATUSTEXT_DATA::ID => Some(Self::STATUSTEXT(STATUSTEXT_DATA::random(rng))),
35396 STORAGE_INFORMATION_DATA::ID => Some(Self::STORAGE_INFORMATION(
35397 STORAGE_INFORMATION_DATA::random(rng),
35398 )),
35399 SUPPORTED_TUNES_DATA::ID => {
35400 Some(Self::SUPPORTED_TUNES(SUPPORTED_TUNES_DATA::random(rng)))
35401 }
35402 SYSTEM_TIME_DATA::ID => Some(Self::SYSTEM_TIME(SYSTEM_TIME_DATA::random(rng))),
35403 SYS_STATUS_DATA::ID => Some(Self::SYS_STATUS(SYS_STATUS_DATA::random(rng))),
35404 TERRAIN_CHECK_DATA::ID => Some(Self::TERRAIN_CHECK(TERRAIN_CHECK_DATA::random(rng))),
35405 TERRAIN_DATA_DATA::ID => Some(Self::TERRAIN_DATA(TERRAIN_DATA_DATA::random(rng))),
35406 TERRAIN_REPORT_DATA::ID => Some(Self::TERRAIN_REPORT(TERRAIN_REPORT_DATA::random(rng))),
35407 TERRAIN_REQUEST_DATA::ID => {
35408 Some(Self::TERRAIN_REQUEST(TERRAIN_REQUEST_DATA::random(rng)))
35409 }
35410 TIMESYNC_DATA::ID => Some(Self::TIMESYNC(TIMESYNC_DATA::random(rng))),
35411 TIME_ESTIMATE_TO_TARGET_DATA::ID => Some(Self::TIME_ESTIMATE_TO_TARGET(
35412 TIME_ESTIMATE_TO_TARGET_DATA::random(rng),
35413 )),
35414 TRAJECTORY_REPRESENTATION_BEZIER_DATA::ID => {
35415 Some(Self::TRAJECTORY_REPRESENTATION_BEZIER(
35416 TRAJECTORY_REPRESENTATION_BEZIER_DATA::random(rng),
35417 ))
35418 }
35419 TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA::ID => {
35420 Some(Self::TRAJECTORY_REPRESENTATION_WAYPOINTS(
35421 TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA::random(rng),
35422 ))
35423 }
35424 TUNNEL_DATA::ID => Some(Self::TUNNEL(TUNNEL_DATA::random(rng))),
35425 UAVCAN_NODE_INFO_DATA::ID => {
35426 Some(Self::UAVCAN_NODE_INFO(UAVCAN_NODE_INFO_DATA::random(rng)))
35427 }
35428 UAVCAN_NODE_STATUS_DATA::ID => Some(Self::UAVCAN_NODE_STATUS(
35429 UAVCAN_NODE_STATUS_DATA::random(rng),
35430 )),
35431 UTM_GLOBAL_POSITION_DATA::ID => Some(Self::UTM_GLOBAL_POSITION(
35432 UTM_GLOBAL_POSITION_DATA::random(rng),
35433 )),
35434 V2_EXTENSION_DATA::ID => Some(Self::V2_EXTENSION(V2_EXTENSION_DATA::random(rng))),
35435 VFR_HUD_DATA::ID => Some(Self::VFR_HUD(VFR_HUD_DATA::random(rng))),
35436 VIBRATION_DATA::ID => Some(Self::VIBRATION(VIBRATION_DATA::random(rng))),
35437 VICON_POSITION_ESTIMATE_DATA::ID => Some(Self::VICON_POSITION_ESTIMATE(
35438 VICON_POSITION_ESTIMATE_DATA::random(rng),
35439 )),
35440 VIDEO_STREAM_INFORMATION_DATA::ID => Some(Self::VIDEO_STREAM_INFORMATION(
35441 VIDEO_STREAM_INFORMATION_DATA::random(rng),
35442 )),
35443 VIDEO_STREAM_STATUS_DATA::ID => Some(Self::VIDEO_STREAM_STATUS(
35444 VIDEO_STREAM_STATUS_DATA::random(rng),
35445 )),
35446 VISION_POSITION_ESTIMATE_DATA::ID => Some(Self::VISION_POSITION_ESTIMATE(
35447 VISION_POSITION_ESTIMATE_DATA::random(rng),
35448 )),
35449 VISION_SPEED_ESTIMATE_DATA::ID => Some(Self::VISION_SPEED_ESTIMATE(
35450 VISION_SPEED_ESTIMATE_DATA::random(rng),
35451 )),
35452 WHEEL_DISTANCE_DATA::ID => Some(Self::WHEEL_DISTANCE(WHEEL_DISTANCE_DATA::random(rng))),
35453 WIFI_CONFIG_AP_DATA::ID => Some(Self::WIFI_CONFIG_AP(WIFI_CONFIG_AP_DATA::random(rng))),
35454 WINCH_STATUS_DATA::ID => Some(Self::WINCH_STATUS(WINCH_STATUS_DATA::random(rng))),
35455 WIND_COV_DATA::ID => Some(Self::WIND_COV(WIND_COV_DATA::random(rng))),
35456 _ => None,
35457 }
35458 }
35459 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
35460 match self {
35461 Self::ACTUATOR_CONTROL_TARGET(body) => body.ser(version, bytes),
35462 Self::ACTUATOR_OUTPUT_STATUS(body) => body.ser(version, bytes),
35463 Self::ADSB_VEHICLE(body) => body.ser(version, bytes),
35464 Self::AIS_VESSEL(body) => body.ser(version, bytes),
35465 Self::ALTITUDE(body) => body.ser(version, bytes),
35466 Self::ATTITUDE(body) => body.ser(version, bytes),
35467 Self::ATTITUDE_QUATERNION(body) => body.ser(version, bytes),
35468 Self::ATTITUDE_QUATERNION_COV(body) => body.ser(version, bytes),
35469 Self::ATTITUDE_TARGET(body) => body.ser(version, bytes),
35470 Self::ATT_POS_MOCAP(body) => body.ser(version, bytes),
35471 Self::AUTH_KEY(body) => body.ser(version, bytes),
35472 Self::AUTOPILOT_STATE_FOR_GIMBAL_DEVICE(body) => body.ser(version, bytes),
35473 Self::AUTOPILOT_VERSION(body) => body.ser(version, bytes),
35474 Self::AVAILABLE_MODES(body) => body.ser(version, bytes),
35475 Self::AVAILABLE_MODES_MONITOR(body) => body.ser(version, bytes),
35476 Self::BATTERY_INFO(body) => body.ser(version, bytes),
35477 Self::BATTERY_STATUS(body) => body.ser(version, bytes),
35478 Self::BUTTON_CHANGE(body) => body.ser(version, bytes),
35479 Self::CAMERA_CAPTURE_STATUS(body) => body.ser(version, bytes),
35480 Self::CAMERA_FOV_STATUS(body) => body.ser(version, bytes),
35481 Self::CAMERA_IMAGE_CAPTURED(body) => body.ser(version, bytes),
35482 Self::CAMERA_INFORMATION(body) => body.ser(version, bytes),
35483 Self::CAMERA_SETTINGS(body) => body.ser(version, bytes),
35484 Self::CAMERA_THERMAL_RANGE(body) => body.ser(version, bytes),
35485 Self::CAMERA_TRACKING_GEO_STATUS(body) => body.ser(version, bytes),
35486 Self::CAMERA_TRACKING_IMAGE_STATUS(body) => body.ser(version, bytes),
35487 Self::CAMERA_TRIGGER(body) => body.ser(version, bytes),
35488 Self::CANFD_FRAME(body) => body.ser(version, bytes),
35489 Self::CAN_FILTER_MODIFY(body) => body.ser(version, bytes),
35490 Self::CAN_FRAME(body) => body.ser(version, bytes),
35491 Self::CELLULAR_CONFIG(body) => body.ser(version, bytes),
35492 Self::CELLULAR_STATUS(body) => body.ser(version, bytes),
35493 Self::CHANGE_OPERATOR_CONTROL(body) => body.ser(version, bytes),
35494 Self::CHANGE_OPERATOR_CONTROL_ACK(body) => body.ser(version, bytes),
35495 Self::COLLISION(body) => body.ser(version, bytes),
35496 Self::COMMAND_ACK(body) => body.ser(version, bytes),
35497 Self::COMMAND_CANCEL(body) => body.ser(version, bytes),
35498 Self::COMMAND_INT(body) => body.ser(version, bytes),
35499 Self::COMMAND_LONG(body) => body.ser(version, bytes),
35500 Self::COMPONENT_INFORMATION(body) => body.ser(version, bytes),
35501 Self::COMPONENT_INFORMATION_BASIC(body) => body.ser(version, bytes),
35502 Self::COMPONENT_METADATA(body) => body.ser(version, bytes),
35503 Self::CONTROL_SYSTEM_STATE(body) => body.ser(version, bytes),
35504 Self::CURRENT_EVENT_SEQUENCE(body) => body.ser(version, bytes),
35505 Self::CURRENT_MODE(body) => body.ser(version, bytes),
35506 Self::DATA_STREAM(body) => body.ser(version, bytes),
35507 Self::DATA_TRANSMISSION_HANDSHAKE(body) => body.ser(version, bytes),
35508 Self::DEBUG(body) => body.ser(version, bytes),
35509 Self::DEBUG_FLOAT_ARRAY(body) => body.ser(version, bytes),
35510 Self::DEBUG_VECT(body) => body.ser(version, bytes),
35511 Self::DISTANCE_SENSOR(body) => body.ser(version, bytes),
35512 Self::EFI_STATUS(body) => body.ser(version, bytes),
35513 Self::ENCAPSULATED_DATA(body) => body.ser(version, bytes),
35514 Self::ESC_INFO(body) => body.ser(version, bytes),
35515 Self::ESC_STATUS(body) => body.ser(version, bytes),
35516 Self::ESTIMATOR_STATUS(body) => body.ser(version, bytes),
35517 Self::EVENT(body) => body.ser(version, bytes),
35518 Self::EXTENDED_SYS_STATE(body) => body.ser(version, bytes),
35519 Self::FENCE_STATUS(body) => body.ser(version, bytes),
35520 Self::FILE_TRANSFER_PROTOCOL(body) => body.ser(version, bytes),
35521 Self::FLIGHT_INFORMATION(body) => body.ser(version, bytes),
35522 Self::FOLLOW_TARGET(body) => body.ser(version, bytes),
35523 Self::FUEL_STATUS(body) => body.ser(version, bytes),
35524 Self::GENERATOR_STATUS(body) => body.ser(version, bytes),
35525 Self::GIMBAL_DEVICE_ATTITUDE_STATUS(body) => body.ser(version, bytes),
35526 Self::GIMBAL_DEVICE_INFORMATION(body) => body.ser(version, bytes),
35527 Self::GIMBAL_DEVICE_SET_ATTITUDE(body) => body.ser(version, bytes),
35528 Self::GIMBAL_MANAGER_INFORMATION(body) => body.ser(version, bytes),
35529 Self::GIMBAL_MANAGER_SET_ATTITUDE(body) => body.ser(version, bytes),
35530 Self::GIMBAL_MANAGER_SET_MANUAL_CONTROL(body) => body.ser(version, bytes),
35531 Self::GIMBAL_MANAGER_SET_PITCHYAW(body) => body.ser(version, bytes),
35532 Self::GIMBAL_MANAGER_STATUS(body) => body.ser(version, bytes),
35533 Self::GLOBAL_POSITION_INT(body) => body.ser(version, bytes),
35534 Self::GLOBAL_POSITION_INT_COV(body) => body.ser(version, bytes),
35535 Self::GLOBAL_VISION_POSITION_ESTIMATE(body) => body.ser(version, bytes),
35536 Self::GPS2_RAW(body) => body.ser(version, bytes),
35537 Self::GPS2_RTK(body) => body.ser(version, bytes),
35538 Self::GPS_GLOBAL_ORIGIN(body) => body.ser(version, bytes),
35539 Self::GPS_INJECT_DATA(body) => body.ser(version, bytes),
35540 Self::GPS_INPUT(body) => body.ser(version, bytes),
35541 Self::GPS_RAW_INT(body) => body.ser(version, bytes),
35542 Self::GPS_RTCM_DATA(body) => body.ser(version, bytes),
35543 Self::GPS_RTK(body) => body.ser(version, bytes),
35544 Self::GPS_STATUS(body) => body.ser(version, bytes),
35545 Self::HEARTBEAT(body) => body.ser(version, bytes),
35546 Self::HIGHRES_IMU(body) => body.ser(version, bytes),
35547 Self::HIGH_LATENCY(body) => body.ser(version, bytes),
35548 Self::HIGH_LATENCY2(body) => body.ser(version, bytes),
35549 Self::HIL_ACTUATOR_CONTROLS(body) => body.ser(version, bytes),
35550 Self::HIL_CONTROLS(body) => body.ser(version, bytes),
35551 Self::HIL_GPS(body) => body.ser(version, bytes),
35552 Self::HIL_OPTICAL_FLOW(body) => body.ser(version, bytes),
35553 Self::HIL_RC_INPUTS_RAW(body) => body.ser(version, bytes),
35554 Self::HIL_SENSOR(body) => body.ser(version, bytes),
35555 Self::HIL_STATE(body) => body.ser(version, bytes),
35556 Self::HIL_STATE_QUATERNION(body) => body.ser(version, bytes),
35557 Self::HOME_POSITION(body) => body.ser(version, bytes),
35558 Self::HYGROMETER_SENSOR(body) => body.ser(version, bytes),
35559 Self::ILLUMINATOR_STATUS(body) => body.ser(version, bytes),
35560 Self::ISBD_LINK_STATUS(body) => body.ser(version, bytes),
35561 Self::LANDING_TARGET(body) => body.ser(version, bytes),
35562 Self::LINK_NODE_STATUS(body) => body.ser(version, bytes),
35563 Self::LOCAL_POSITION_NED(body) => body.ser(version, bytes),
35564 Self::LOCAL_POSITION_NED_COV(body) => body.ser(version, bytes),
35565 Self::LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET(body) => body.ser(version, bytes),
35566 Self::LOGGING_ACK(body) => body.ser(version, bytes),
35567 Self::LOGGING_DATA(body) => body.ser(version, bytes),
35568 Self::LOGGING_DATA_ACKED(body) => body.ser(version, bytes),
35569 Self::LOG_DATA(body) => body.ser(version, bytes),
35570 Self::LOG_ENTRY(body) => body.ser(version, bytes),
35571 Self::LOG_ERASE(body) => body.ser(version, bytes),
35572 Self::LOG_REQUEST_DATA(body) => body.ser(version, bytes),
35573 Self::LOG_REQUEST_END(body) => body.ser(version, bytes),
35574 Self::LOG_REQUEST_LIST(body) => body.ser(version, bytes),
35575 Self::MAG_CAL_REPORT(body) => body.ser(version, bytes),
35576 Self::MANUAL_CONTROL(body) => body.ser(version, bytes),
35577 Self::MANUAL_SETPOINT(body) => body.ser(version, bytes),
35578 Self::MEMORY_VECT(body) => body.ser(version, bytes),
35579 Self::MESSAGE_INTERVAL(body) => body.ser(version, bytes),
35580 Self::MISSION_ACK(body) => body.ser(version, bytes),
35581 Self::MISSION_CLEAR_ALL(body) => body.ser(version, bytes),
35582 Self::MISSION_COUNT(body) => body.ser(version, bytes),
35583 Self::MISSION_CURRENT(body) => body.ser(version, bytes),
35584 Self::MISSION_ITEM(body) => body.ser(version, bytes),
35585 Self::MISSION_ITEM_INT(body) => body.ser(version, bytes),
35586 Self::MISSION_ITEM_REACHED(body) => body.ser(version, bytes),
35587 Self::MISSION_REQUEST(body) => body.ser(version, bytes),
35588 Self::MISSION_REQUEST_INT(body) => body.ser(version, bytes),
35589 Self::MISSION_REQUEST_LIST(body) => body.ser(version, bytes),
35590 Self::MISSION_REQUEST_PARTIAL_LIST(body) => body.ser(version, bytes),
35591 Self::MISSION_SET_CURRENT(body) => body.ser(version, bytes),
35592 Self::MISSION_WRITE_PARTIAL_LIST(body) => body.ser(version, bytes),
35593 Self::MOUNT_ORIENTATION(body) => body.ser(version, bytes),
35594 Self::NAMED_VALUE_FLOAT(body) => body.ser(version, bytes),
35595 Self::NAMED_VALUE_INT(body) => body.ser(version, bytes),
35596 Self::NAV_CONTROLLER_OUTPUT(body) => body.ser(version, bytes),
35597 Self::OBSTACLE_DISTANCE(body) => body.ser(version, bytes),
35598 Self::ODOMETRY(body) => body.ser(version, bytes),
35599 Self::ONBOARD_COMPUTER_STATUS(body) => body.ser(version, bytes),
35600 Self::OPEN_DRONE_ID_ARM_STATUS(body) => body.ser(version, bytes),
35601 Self::OPEN_DRONE_ID_AUTHENTICATION(body) => body.ser(version, bytes),
35602 Self::OPEN_DRONE_ID_BASIC_ID(body) => body.ser(version, bytes),
35603 Self::OPEN_DRONE_ID_LOCATION(body) => body.ser(version, bytes),
35604 Self::OPEN_DRONE_ID_MESSAGE_PACK(body) => body.ser(version, bytes),
35605 Self::OPEN_DRONE_ID_OPERATOR_ID(body) => body.ser(version, bytes),
35606 Self::OPEN_DRONE_ID_SELF_ID(body) => body.ser(version, bytes),
35607 Self::OPEN_DRONE_ID_SYSTEM(body) => body.ser(version, bytes),
35608 Self::OPEN_DRONE_ID_SYSTEM_UPDATE(body) => body.ser(version, bytes),
35609 Self::OPTICAL_FLOW(body) => body.ser(version, bytes),
35610 Self::OPTICAL_FLOW_RAD(body) => body.ser(version, bytes),
35611 Self::ORBIT_EXECUTION_STATUS(body) => body.ser(version, bytes),
35612 Self::PARAM_EXT_ACK(body) => body.ser(version, bytes),
35613 Self::PARAM_EXT_REQUEST_LIST(body) => body.ser(version, bytes),
35614 Self::PARAM_EXT_REQUEST_READ(body) => body.ser(version, bytes),
35615 Self::PARAM_EXT_SET(body) => body.ser(version, bytes),
35616 Self::PARAM_EXT_VALUE(body) => body.ser(version, bytes),
35617 Self::PARAM_MAP_RC(body) => body.ser(version, bytes),
35618 Self::PARAM_REQUEST_LIST(body) => body.ser(version, bytes),
35619 Self::PARAM_REQUEST_READ(body) => body.ser(version, bytes),
35620 Self::PARAM_SET(body) => body.ser(version, bytes),
35621 Self::PARAM_VALUE(body) => body.ser(version, bytes),
35622 Self::PING(body) => body.ser(version, bytes),
35623 Self::PLAY_TUNE(body) => body.ser(version, bytes),
35624 Self::PLAY_TUNE_V2(body) => body.ser(version, bytes),
35625 Self::POSITION_TARGET_GLOBAL_INT(body) => body.ser(version, bytes),
35626 Self::POSITION_TARGET_LOCAL_NED(body) => body.ser(version, bytes),
35627 Self::POWER_STATUS(body) => body.ser(version, bytes),
35628 Self::PROTOCOL_VERSION(body) => body.ser(version, bytes),
35629 Self::RADIO_STATUS(body) => body.ser(version, bytes),
35630 Self::RAW_IMU(body) => body.ser(version, bytes),
35631 Self::RAW_PRESSURE(body) => body.ser(version, bytes),
35632 Self::RAW_RPM(body) => body.ser(version, bytes),
35633 Self::RC_CHANNELS(body) => body.ser(version, bytes),
35634 Self::RC_CHANNELS_OVERRIDE(body) => body.ser(version, bytes),
35635 Self::RC_CHANNELS_RAW(body) => body.ser(version, bytes),
35636 Self::RC_CHANNELS_SCALED(body) => body.ser(version, bytes),
35637 Self::REQUEST_DATA_STREAM(body) => body.ser(version, bytes),
35638 Self::REQUEST_EVENT(body) => body.ser(version, bytes),
35639 Self::RESOURCE_REQUEST(body) => body.ser(version, bytes),
35640 Self::RESPONSE_EVENT_ERROR(body) => body.ser(version, bytes),
35641 Self::SAFETY_ALLOWED_AREA(body) => body.ser(version, bytes),
35642 Self::SAFETY_SET_ALLOWED_AREA(body) => body.ser(version, bytes),
35643 Self::SCALED_IMU(body) => body.ser(version, bytes),
35644 Self::SCALED_IMU2(body) => body.ser(version, bytes),
35645 Self::SCALED_IMU3(body) => body.ser(version, bytes),
35646 Self::SCALED_PRESSURE(body) => body.ser(version, bytes),
35647 Self::SCALED_PRESSURE2(body) => body.ser(version, bytes),
35648 Self::SCALED_PRESSURE3(body) => body.ser(version, bytes),
35649 Self::SERIAL_CONTROL(body) => body.ser(version, bytes),
35650 Self::SERVO_OUTPUT_RAW(body) => body.ser(version, bytes),
35651 Self::SETUP_SIGNING(body) => body.ser(version, bytes),
35652 Self::SET_ACTUATOR_CONTROL_TARGET(body) => body.ser(version, bytes),
35653 Self::SET_ATTITUDE_TARGET(body) => body.ser(version, bytes),
35654 Self::SET_GPS_GLOBAL_ORIGIN(body) => body.ser(version, bytes),
35655 Self::SET_HOME_POSITION(body) => body.ser(version, bytes),
35656 Self::SET_MODE(body) => body.ser(version, bytes),
35657 Self::SET_POSITION_TARGET_GLOBAL_INT(body) => body.ser(version, bytes),
35658 Self::SET_POSITION_TARGET_LOCAL_NED(body) => body.ser(version, bytes),
35659 Self::SIM_STATE(body) => body.ser(version, bytes),
35660 Self::SMART_BATTERY_INFO(body) => body.ser(version, bytes),
35661 Self::STATUSTEXT(body) => body.ser(version, bytes),
35662 Self::STORAGE_INFORMATION(body) => body.ser(version, bytes),
35663 Self::SUPPORTED_TUNES(body) => body.ser(version, bytes),
35664 Self::SYSTEM_TIME(body) => body.ser(version, bytes),
35665 Self::SYS_STATUS(body) => body.ser(version, bytes),
35666 Self::TERRAIN_CHECK(body) => body.ser(version, bytes),
35667 Self::TERRAIN_DATA(body) => body.ser(version, bytes),
35668 Self::TERRAIN_REPORT(body) => body.ser(version, bytes),
35669 Self::TERRAIN_REQUEST(body) => body.ser(version, bytes),
35670 Self::TIMESYNC(body) => body.ser(version, bytes),
35671 Self::TIME_ESTIMATE_TO_TARGET(body) => body.ser(version, bytes),
35672 Self::TRAJECTORY_REPRESENTATION_BEZIER(body) => body.ser(version, bytes),
35673 Self::TRAJECTORY_REPRESENTATION_WAYPOINTS(body) => body.ser(version, bytes),
35674 Self::TUNNEL(body) => body.ser(version, bytes),
35675 Self::UAVCAN_NODE_INFO(body) => body.ser(version, bytes),
35676 Self::UAVCAN_NODE_STATUS(body) => body.ser(version, bytes),
35677 Self::UTM_GLOBAL_POSITION(body) => body.ser(version, bytes),
35678 Self::V2_EXTENSION(body) => body.ser(version, bytes),
35679 Self::VFR_HUD(body) => body.ser(version, bytes),
35680 Self::VIBRATION(body) => body.ser(version, bytes),
35681 Self::VICON_POSITION_ESTIMATE(body) => body.ser(version, bytes),
35682 Self::VIDEO_STREAM_INFORMATION(body) => body.ser(version, bytes),
35683 Self::VIDEO_STREAM_STATUS(body) => body.ser(version, bytes),
35684 Self::VISION_POSITION_ESTIMATE(body) => body.ser(version, bytes),
35685 Self::VISION_SPEED_ESTIMATE(body) => body.ser(version, bytes),
35686 Self::WHEEL_DISTANCE(body) => body.ser(version, bytes),
35687 Self::WIFI_CONFIG_AP(body) => body.ser(version, bytes),
35688 Self::WINCH_STATUS(body) => body.ser(version, bytes),
35689 Self::WIND_COV(body) => body.ser(version, bytes),
35690 }
35691 }
35692 fn extra_crc(id: u32) -> u8 {
35693 match id {
35694 ACTUATOR_CONTROL_TARGET_DATA::ID => ACTUATOR_CONTROL_TARGET_DATA::EXTRA_CRC,
35695 ACTUATOR_OUTPUT_STATUS_DATA::ID => ACTUATOR_OUTPUT_STATUS_DATA::EXTRA_CRC,
35696 ADSB_VEHICLE_DATA::ID => ADSB_VEHICLE_DATA::EXTRA_CRC,
35697 AIS_VESSEL_DATA::ID => AIS_VESSEL_DATA::EXTRA_CRC,
35698 ALTITUDE_DATA::ID => ALTITUDE_DATA::EXTRA_CRC,
35699 ATTITUDE_DATA::ID => ATTITUDE_DATA::EXTRA_CRC,
35700 ATTITUDE_QUATERNION_DATA::ID => ATTITUDE_QUATERNION_DATA::EXTRA_CRC,
35701 ATTITUDE_QUATERNION_COV_DATA::ID => ATTITUDE_QUATERNION_COV_DATA::EXTRA_CRC,
35702 ATTITUDE_TARGET_DATA::ID => ATTITUDE_TARGET_DATA::EXTRA_CRC,
35703 ATT_POS_MOCAP_DATA::ID => ATT_POS_MOCAP_DATA::EXTRA_CRC,
35704 AUTH_KEY_DATA::ID => AUTH_KEY_DATA::EXTRA_CRC,
35705 AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA::ID => {
35706 AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA::EXTRA_CRC
35707 }
35708 AUTOPILOT_VERSION_DATA::ID => AUTOPILOT_VERSION_DATA::EXTRA_CRC,
35709 AVAILABLE_MODES_DATA::ID => AVAILABLE_MODES_DATA::EXTRA_CRC,
35710 AVAILABLE_MODES_MONITOR_DATA::ID => AVAILABLE_MODES_MONITOR_DATA::EXTRA_CRC,
35711 BATTERY_INFO_DATA::ID => BATTERY_INFO_DATA::EXTRA_CRC,
35712 BATTERY_STATUS_DATA::ID => BATTERY_STATUS_DATA::EXTRA_CRC,
35713 BUTTON_CHANGE_DATA::ID => BUTTON_CHANGE_DATA::EXTRA_CRC,
35714 CAMERA_CAPTURE_STATUS_DATA::ID => CAMERA_CAPTURE_STATUS_DATA::EXTRA_CRC,
35715 CAMERA_FOV_STATUS_DATA::ID => CAMERA_FOV_STATUS_DATA::EXTRA_CRC,
35716 CAMERA_IMAGE_CAPTURED_DATA::ID => CAMERA_IMAGE_CAPTURED_DATA::EXTRA_CRC,
35717 CAMERA_INFORMATION_DATA::ID => CAMERA_INFORMATION_DATA::EXTRA_CRC,
35718 CAMERA_SETTINGS_DATA::ID => CAMERA_SETTINGS_DATA::EXTRA_CRC,
35719 CAMERA_THERMAL_RANGE_DATA::ID => CAMERA_THERMAL_RANGE_DATA::EXTRA_CRC,
35720 CAMERA_TRACKING_GEO_STATUS_DATA::ID => CAMERA_TRACKING_GEO_STATUS_DATA::EXTRA_CRC,
35721 CAMERA_TRACKING_IMAGE_STATUS_DATA::ID => CAMERA_TRACKING_IMAGE_STATUS_DATA::EXTRA_CRC,
35722 CAMERA_TRIGGER_DATA::ID => CAMERA_TRIGGER_DATA::EXTRA_CRC,
35723 CANFD_FRAME_DATA::ID => CANFD_FRAME_DATA::EXTRA_CRC,
35724 CAN_FILTER_MODIFY_DATA::ID => CAN_FILTER_MODIFY_DATA::EXTRA_CRC,
35725 CAN_FRAME_DATA::ID => CAN_FRAME_DATA::EXTRA_CRC,
35726 CELLULAR_CONFIG_DATA::ID => CELLULAR_CONFIG_DATA::EXTRA_CRC,
35727 CELLULAR_STATUS_DATA::ID => CELLULAR_STATUS_DATA::EXTRA_CRC,
35728 CHANGE_OPERATOR_CONTROL_DATA::ID => CHANGE_OPERATOR_CONTROL_DATA::EXTRA_CRC,
35729 CHANGE_OPERATOR_CONTROL_ACK_DATA::ID => CHANGE_OPERATOR_CONTROL_ACK_DATA::EXTRA_CRC,
35730 COLLISION_DATA::ID => COLLISION_DATA::EXTRA_CRC,
35731 COMMAND_ACK_DATA::ID => COMMAND_ACK_DATA::EXTRA_CRC,
35732 COMMAND_CANCEL_DATA::ID => COMMAND_CANCEL_DATA::EXTRA_CRC,
35733 COMMAND_INT_DATA::ID => COMMAND_INT_DATA::EXTRA_CRC,
35734 COMMAND_LONG_DATA::ID => COMMAND_LONG_DATA::EXTRA_CRC,
35735 COMPONENT_INFORMATION_DATA::ID => COMPONENT_INFORMATION_DATA::EXTRA_CRC,
35736 COMPONENT_INFORMATION_BASIC_DATA::ID => COMPONENT_INFORMATION_BASIC_DATA::EXTRA_CRC,
35737 COMPONENT_METADATA_DATA::ID => COMPONENT_METADATA_DATA::EXTRA_CRC,
35738 CONTROL_SYSTEM_STATE_DATA::ID => CONTROL_SYSTEM_STATE_DATA::EXTRA_CRC,
35739 CURRENT_EVENT_SEQUENCE_DATA::ID => CURRENT_EVENT_SEQUENCE_DATA::EXTRA_CRC,
35740 CURRENT_MODE_DATA::ID => CURRENT_MODE_DATA::EXTRA_CRC,
35741 DATA_STREAM_DATA::ID => DATA_STREAM_DATA::EXTRA_CRC,
35742 DATA_TRANSMISSION_HANDSHAKE_DATA::ID => DATA_TRANSMISSION_HANDSHAKE_DATA::EXTRA_CRC,
35743 DEBUG_DATA::ID => DEBUG_DATA::EXTRA_CRC,
35744 DEBUG_FLOAT_ARRAY_DATA::ID => DEBUG_FLOAT_ARRAY_DATA::EXTRA_CRC,
35745 DEBUG_VECT_DATA::ID => DEBUG_VECT_DATA::EXTRA_CRC,
35746 DISTANCE_SENSOR_DATA::ID => DISTANCE_SENSOR_DATA::EXTRA_CRC,
35747 EFI_STATUS_DATA::ID => EFI_STATUS_DATA::EXTRA_CRC,
35748 ENCAPSULATED_DATA_DATA::ID => ENCAPSULATED_DATA_DATA::EXTRA_CRC,
35749 ESC_INFO_DATA::ID => ESC_INFO_DATA::EXTRA_CRC,
35750 ESC_STATUS_DATA::ID => ESC_STATUS_DATA::EXTRA_CRC,
35751 ESTIMATOR_STATUS_DATA::ID => ESTIMATOR_STATUS_DATA::EXTRA_CRC,
35752 EVENT_DATA::ID => EVENT_DATA::EXTRA_CRC,
35753 EXTENDED_SYS_STATE_DATA::ID => EXTENDED_SYS_STATE_DATA::EXTRA_CRC,
35754 FENCE_STATUS_DATA::ID => FENCE_STATUS_DATA::EXTRA_CRC,
35755 FILE_TRANSFER_PROTOCOL_DATA::ID => FILE_TRANSFER_PROTOCOL_DATA::EXTRA_CRC,
35756 FLIGHT_INFORMATION_DATA::ID => FLIGHT_INFORMATION_DATA::EXTRA_CRC,
35757 FOLLOW_TARGET_DATA::ID => FOLLOW_TARGET_DATA::EXTRA_CRC,
35758 FUEL_STATUS_DATA::ID => FUEL_STATUS_DATA::EXTRA_CRC,
35759 GENERATOR_STATUS_DATA::ID => GENERATOR_STATUS_DATA::EXTRA_CRC,
35760 GIMBAL_DEVICE_ATTITUDE_STATUS_DATA::ID => GIMBAL_DEVICE_ATTITUDE_STATUS_DATA::EXTRA_CRC,
35761 GIMBAL_DEVICE_INFORMATION_DATA::ID => GIMBAL_DEVICE_INFORMATION_DATA::EXTRA_CRC,
35762 GIMBAL_DEVICE_SET_ATTITUDE_DATA::ID => GIMBAL_DEVICE_SET_ATTITUDE_DATA::EXTRA_CRC,
35763 GIMBAL_MANAGER_INFORMATION_DATA::ID => GIMBAL_MANAGER_INFORMATION_DATA::EXTRA_CRC,
35764 GIMBAL_MANAGER_SET_ATTITUDE_DATA::ID => GIMBAL_MANAGER_SET_ATTITUDE_DATA::EXTRA_CRC,
35765 GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA::ID => {
35766 GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA::EXTRA_CRC
35767 }
35768 GIMBAL_MANAGER_SET_PITCHYAW_DATA::ID => GIMBAL_MANAGER_SET_PITCHYAW_DATA::EXTRA_CRC,
35769 GIMBAL_MANAGER_STATUS_DATA::ID => GIMBAL_MANAGER_STATUS_DATA::EXTRA_CRC,
35770 GLOBAL_POSITION_INT_DATA::ID => GLOBAL_POSITION_INT_DATA::EXTRA_CRC,
35771 GLOBAL_POSITION_INT_COV_DATA::ID => GLOBAL_POSITION_INT_COV_DATA::EXTRA_CRC,
35772 GLOBAL_VISION_POSITION_ESTIMATE_DATA::ID => {
35773 GLOBAL_VISION_POSITION_ESTIMATE_DATA::EXTRA_CRC
35774 }
35775 GPS2_RAW_DATA::ID => GPS2_RAW_DATA::EXTRA_CRC,
35776 GPS2_RTK_DATA::ID => GPS2_RTK_DATA::EXTRA_CRC,
35777 GPS_GLOBAL_ORIGIN_DATA::ID => GPS_GLOBAL_ORIGIN_DATA::EXTRA_CRC,
35778 GPS_INJECT_DATA_DATA::ID => GPS_INJECT_DATA_DATA::EXTRA_CRC,
35779 GPS_INPUT_DATA::ID => GPS_INPUT_DATA::EXTRA_CRC,
35780 GPS_RAW_INT_DATA::ID => GPS_RAW_INT_DATA::EXTRA_CRC,
35781 GPS_RTCM_DATA_DATA::ID => GPS_RTCM_DATA_DATA::EXTRA_CRC,
35782 GPS_RTK_DATA::ID => GPS_RTK_DATA::EXTRA_CRC,
35783 GPS_STATUS_DATA::ID => GPS_STATUS_DATA::EXTRA_CRC,
35784 HEARTBEAT_DATA::ID => HEARTBEAT_DATA::EXTRA_CRC,
35785 HIGHRES_IMU_DATA::ID => HIGHRES_IMU_DATA::EXTRA_CRC,
35786 HIGH_LATENCY_DATA::ID => HIGH_LATENCY_DATA::EXTRA_CRC,
35787 HIGH_LATENCY2_DATA::ID => HIGH_LATENCY2_DATA::EXTRA_CRC,
35788 HIL_ACTUATOR_CONTROLS_DATA::ID => HIL_ACTUATOR_CONTROLS_DATA::EXTRA_CRC,
35789 HIL_CONTROLS_DATA::ID => HIL_CONTROLS_DATA::EXTRA_CRC,
35790 HIL_GPS_DATA::ID => HIL_GPS_DATA::EXTRA_CRC,
35791 HIL_OPTICAL_FLOW_DATA::ID => HIL_OPTICAL_FLOW_DATA::EXTRA_CRC,
35792 HIL_RC_INPUTS_RAW_DATA::ID => HIL_RC_INPUTS_RAW_DATA::EXTRA_CRC,
35793 HIL_SENSOR_DATA::ID => HIL_SENSOR_DATA::EXTRA_CRC,
35794 HIL_STATE_DATA::ID => HIL_STATE_DATA::EXTRA_CRC,
35795 HIL_STATE_QUATERNION_DATA::ID => HIL_STATE_QUATERNION_DATA::EXTRA_CRC,
35796 HOME_POSITION_DATA::ID => HOME_POSITION_DATA::EXTRA_CRC,
35797 HYGROMETER_SENSOR_DATA::ID => HYGROMETER_SENSOR_DATA::EXTRA_CRC,
35798 ILLUMINATOR_STATUS_DATA::ID => ILLUMINATOR_STATUS_DATA::EXTRA_CRC,
35799 ISBD_LINK_STATUS_DATA::ID => ISBD_LINK_STATUS_DATA::EXTRA_CRC,
35800 LANDING_TARGET_DATA::ID => LANDING_TARGET_DATA::EXTRA_CRC,
35801 LINK_NODE_STATUS_DATA::ID => LINK_NODE_STATUS_DATA::EXTRA_CRC,
35802 LOCAL_POSITION_NED_DATA::ID => LOCAL_POSITION_NED_DATA::EXTRA_CRC,
35803 LOCAL_POSITION_NED_COV_DATA::ID => LOCAL_POSITION_NED_COV_DATA::EXTRA_CRC,
35804 LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA::ID => {
35805 LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA::EXTRA_CRC
35806 }
35807 LOGGING_ACK_DATA::ID => LOGGING_ACK_DATA::EXTRA_CRC,
35808 LOGGING_DATA_DATA::ID => LOGGING_DATA_DATA::EXTRA_CRC,
35809 LOGGING_DATA_ACKED_DATA::ID => LOGGING_DATA_ACKED_DATA::EXTRA_CRC,
35810 LOG_DATA_DATA::ID => LOG_DATA_DATA::EXTRA_CRC,
35811 LOG_ENTRY_DATA::ID => LOG_ENTRY_DATA::EXTRA_CRC,
35812 LOG_ERASE_DATA::ID => LOG_ERASE_DATA::EXTRA_CRC,
35813 LOG_REQUEST_DATA_DATA::ID => LOG_REQUEST_DATA_DATA::EXTRA_CRC,
35814 LOG_REQUEST_END_DATA::ID => LOG_REQUEST_END_DATA::EXTRA_CRC,
35815 LOG_REQUEST_LIST_DATA::ID => LOG_REQUEST_LIST_DATA::EXTRA_CRC,
35816 MAG_CAL_REPORT_DATA::ID => MAG_CAL_REPORT_DATA::EXTRA_CRC,
35817 MANUAL_CONTROL_DATA::ID => MANUAL_CONTROL_DATA::EXTRA_CRC,
35818 MANUAL_SETPOINT_DATA::ID => MANUAL_SETPOINT_DATA::EXTRA_CRC,
35819 MEMORY_VECT_DATA::ID => MEMORY_VECT_DATA::EXTRA_CRC,
35820 MESSAGE_INTERVAL_DATA::ID => MESSAGE_INTERVAL_DATA::EXTRA_CRC,
35821 MISSION_ACK_DATA::ID => MISSION_ACK_DATA::EXTRA_CRC,
35822 MISSION_CLEAR_ALL_DATA::ID => MISSION_CLEAR_ALL_DATA::EXTRA_CRC,
35823 MISSION_COUNT_DATA::ID => MISSION_COUNT_DATA::EXTRA_CRC,
35824 MISSION_CURRENT_DATA::ID => MISSION_CURRENT_DATA::EXTRA_CRC,
35825 MISSION_ITEM_DATA::ID => MISSION_ITEM_DATA::EXTRA_CRC,
35826 MISSION_ITEM_INT_DATA::ID => MISSION_ITEM_INT_DATA::EXTRA_CRC,
35827 MISSION_ITEM_REACHED_DATA::ID => MISSION_ITEM_REACHED_DATA::EXTRA_CRC,
35828 MISSION_REQUEST_DATA::ID => MISSION_REQUEST_DATA::EXTRA_CRC,
35829 MISSION_REQUEST_INT_DATA::ID => MISSION_REQUEST_INT_DATA::EXTRA_CRC,
35830 MISSION_REQUEST_LIST_DATA::ID => MISSION_REQUEST_LIST_DATA::EXTRA_CRC,
35831 MISSION_REQUEST_PARTIAL_LIST_DATA::ID => MISSION_REQUEST_PARTIAL_LIST_DATA::EXTRA_CRC,
35832 MISSION_SET_CURRENT_DATA::ID => MISSION_SET_CURRENT_DATA::EXTRA_CRC,
35833 MISSION_WRITE_PARTIAL_LIST_DATA::ID => MISSION_WRITE_PARTIAL_LIST_DATA::EXTRA_CRC,
35834 MOUNT_ORIENTATION_DATA::ID => MOUNT_ORIENTATION_DATA::EXTRA_CRC,
35835 NAMED_VALUE_FLOAT_DATA::ID => NAMED_VALUE_FLOAT_DATA::EXTRA_CRC,
35836 NAMED_VALUE_INT_DATA::ID => NAMED_VALUE_INT_DATA::EXTRA_CRC,
35837 NAV_CONTROLLER_OUTPUT_DATA::ID => NAV_CONTROLLER_OUTPUT_DATA::EXTRA_CRC,
35838 OBSTACLE_DISTANCE_DATA::ID => OBSTACLE_DISTANCE_DATA::EXTRA_CRC,
35839 ODOMETRY_DATA::ID => ODOMETRY_DATA::EXTRA_CRC,
35840 ONBOARD_COMPUTER_STATUS_DATA::ID => ONBOARD_COMPUTER_STATUS_DATA::EXTRA_CRC,
35841 OPEN_DRONE_ID_ARM_STATUS_DATA::ID => OPEN_DRONE_ID_ARM_STATUS_DATA::EXTRA_CRC,
35842 OPEN_DRONE_ID_AUTHENTICATION_DATA::ID => OPEN_DRONE_ID_AUTHENTICATION_DATA::EXTRA_CRC,
35843 OPEN_DRONE_ID_BASIC_ID_DATA::ID => OPEN_DRONE_ID_BASIC_ID_DATA::EXTRA_CRC,
35844 OPEN_DRONE_ID_LOCATION_DATA::ID => OPEN_DRONE_ID_LOCATION_DATA::EXTRA_CRC,
35845 OPEN_DRONE_ID_MESSAGE_PACK_DATA::ID => OPEN_DRONE_ID_MESSAGE_PACK_DATA::EXTRA_CRC,
35846 OPEN_DRONE_ID_OPERATOR_ID_DATA::ID => OPEN_DRONE_ID_OPERATOR_ID_DATA::EXTRA_CRC,
35847 OPEN_DRONE_ID_SELF_ID_DATA::ID => OPEN_DRONE_ID_SELF_ID_DATA::EXTRA_CRC,
35848 OPEN_DRONE_ID_SYSTEM_DATA::ID => OPEN_DRONE_ID_SYSTEM_DATA::EXTRA_CRC,
35849 OPEN_DRONE_ID_SYSTEM_UPDATE_DATA::ID => OPEN_DRONE_ID_SYSTEM_UPDATE_DATA::EXTRA_CRC,
35850 OPTICAL_FLOW_DATA::ID => OPTICAL_FLOW_DATA::EXTRA_CRC,
35851 OPTICAL_FLOW_RAD_DATA::ID => OPTICAL_FLOW_RAD_DATA::EXTRA_CRC,
35852 ORBIT_EXECUTION_STATUS_DATA::ID => ORBIT_EXECUTION_STATUS_DATA::EXTRA_CRC,
35853 PARAM_EXT_ACK_DATA::ID => PARAM_EXT_ACK_DATA::EXTRA_CRC,
35854 PARAM_EXT_REQUEST_LIST_DATA::ID => PARAM_EXT_REQUEST_LIST_DATA::EXTRA_CRC,
35855 PARAM_EXT_REQUEST_READ_DATA::ID => PARAM_EXT_REQUEST_READ_DATA::EXTRA_CRC,
35856 PARAM_EXT_SET_DATA::ID => PARAM_EXT_SET_DATA::EXTRA_CRC,
35857 PARAM_EXT_VALUE_DATA::ID => PARAM_EXT_VALUE_DATA::EXTRA_CRC,
35858 PARAM_MAP_RC_DATA::ID => PARAM_MAP_RC_DATA::EXTRA_CRC,
35859 PARAM_REQUEST_LIST_DATA::ID => PARAM_REQUEST_LIST_DATA::EXTRA_CRC,
35860 PARAM_REQUEST_READ_DATA::ID => PARAM_REQUEST_READ_DATA::EXTRA_CRC,
35861 PARAM_SET_DATA::ID => PARAM_SET_DATA::EXTRA_CRC,
35862 PARAM_VALUE_DATA::ID => PARAM_VALUE_DATA::EXTRA_CRC,
35863 PING_DATA::ID => PING_DATA::EXTRA_CRC,
35864 PLAY_TUNE_DATA::ID => PLAY_TUNE_DATA::EXTRA_CRC,
35865 PLAY_TUNE_V2_DATA::ID => PLAY_TUNE_V2_DATA::EXTRA_CRC,
35866 POSITION_TARGET_GLOBAL_INT_DATA::ID => POSITION_TARGET_GLOBAL_INT_DATA::EXTRA_CRC,
35867 POSITION_TARGET_LOCAL_NED_DATA::ID => POSITION_TARGET_LOCAL_NED_DATA::EXTRA_CRC,
35868 POWER_STATUS_DATA::ID => POWER_STATUS_DATA::EXTRA_CRC,
35869 PROTOCOL_VERSION_DATA::ID => PROTOCOL_VERSION_DATA::EXTRA_CRC,
35870 RADIO_STATUS_DATA::ID => RADIO_STATUS_DATA::EXTRA_CRC,
35871 RAW_IMU_DATA::ID => RAW_IMU_DATA::EXTRA_CRC,
35872 RAW_PRESSURE_DATA::ID => RAW_PRESSURE_DATA::EXTRA_CRC,
35873 RAW_RPM_DATA::ID => RAW_RPM_DATA::EXTRA_CRC,
35874 RC_CHANNELS_DATA::ID => RC_CHANNELS_DATA::EXTRA_CRC,
35875 RC_CHANNELS_OVERRIDE_DATA::ID => RC_CHANNELS_OVERRIDE_DATA::EXTRA_CRC,
35876 RC_CHANNELS_RAW_DATA::ID => RC_CHANNELS_RAW_DATA::EXTRA_CRC,
35877 RC_CHANNELS_SCALED_DATA::ID => RC_CHANNELS_SCALED_DATA::EXTRA_CRC,
35878 REQUEST_DATA_STREAM_DATA::ID => REQUEST_DATA_STREAM_DATA::EXTRA_CRC,
35879 REQUEST_EVENT_DATA::ID => REQUEST_EVENT_DATA::EXTRA_CRC,
35880 RESOURCE_REQUEST_DATA::ID => RESOURCE_REQUEST_DATA::EXTRA_CRC,
35881 RESPONSE_EVENT_ERROR_DATA::ID => RESPONSE_EVENT_ERROR_DATA::EXTRA_CRC,
35882 SAFETY_ALLOWED_AREA_DATA::ID => SAFETY_ALLOWED_AREA_DATA::EXTRA_CRC,
35883 SAFETY_SET_ALLOWED_AREA_DATA::ID => SAFETY_SET_ALLOWED_AREA_DATA::EXTRA_CRC,
35884 SCALED_IMU_DATA::ID => SCALED_IMU_DATA::EXTRA_CRC,
35885 SCALED_IMU2_DATA::ID => SCALED_IMU2_DATA::EXTRA_CRC,
35886 SCALED_IMU3_DATA::ID => SCALED_IMU3_DATA::EXTRA_CRC,
35887 SCALED_PRESSURE_DATA::ID => SCALED_PRESSURE_DATA::EXTRA_CRC,
35888 SCALED_PRESSURE2_DATA::ID => SCALED_PRESSURE2_DATA::EXTRA_CRC,
35889 SCALED_PRESSURE3_DATA::ID => SCALED_PRESSURE3_DATA::EXTRA_CRC,
35890 SERIAL_CONTROL_DATA::ID => SERIAL_CONTROL_DATA::EXTRA_CRC,
35891 SERVO_OUTPUT_RAW_DATA::ID => SERVO_OUTPUT_RAW_DATA::EXTRA_CRC,
35892 SETUP_SIGNING_DATA::ID => SETUP_SIGNING_DATA::EXTRA_CRC,
35893 SET_ACTUATOR_CONTROL_TARGET_DATA::ID => SET_ACTUATOR_CONTROL_TARGET_DATA::EXTRA_CRC,
35894 SET_ATTITUDE_TARGET_DATA::ID => SET_ATTITUDE_TARGET_DATA::EXTRA_CRC,
35895 SET_GPS_GLOBAL_ORIGIN_DATA::ID => SET_GPS_GLOBAL_ORIGIN_DATA::EXTRA_CRC,
35896 SET_HOME_POSITION_DATA::ID => SET_HOME_POSITION_DATA::EXTRA_CRC,
35897 SET_MODE_DATA::ID => SET_MODE_DATA::EXTRA_CRC,
35898 SET_POSITION_TARGET_GLOBAL_INT_DATA::ID => {
35899 SET_POSITION_TARGET_GLOBAL_INT_DATA::EXTRA_CRC
35900 }
35901 SET_POSITION_TARGET_LOCAL_NED_DATA::ID => SET_POSITION_TARGET_LOCAL_NED_DATA::EXTRA_CRC,
35902 SIM_STATE_DATA::ID => SIM_STATE_DATA::EXTRA_CRC,
35903 SMART_BATTERY_INFO_DATA::ID => SMART_BATTERY_INFO_DATA::EXTRA_CRC,
35904 STATUSTEXT_DATA::ID => STATUSTEXT_DATA::EXTRA_CRC,
35905 STORAGE_INFORMATION_DATA::ID => STORAGE_INFORMATION_DATA::EXTRA_CRC,
35906 SUPPORTED_TUNES_DATA::ID => SUPPORTED_TUNES_DATA::EXTRA_CRC,
35907 SYSTEM_TIME_DATA::ID => SYSTEM_TIME_DATA::EXTRA_CRC,
35908 SYS_STATUS_DATA::ID => SYS_STATUS_DATA::EXTRA_CRC,
35909 TERRAIN_CHECK_DATA::ID => TERRAIN_CHECK_DATA::EXTRA_CRC,
35910 TERRAIN_DATA_DATA::ID => TERRAIN_DATA_DATA::EXTRA_CRC,
35911 TERRAIN_REPORT_DATA::ID => TERRAIN_REPORT_DATA::EXTRA_CRC,
35912 TERRAIN_REQUEST_DATA::ID => TERRAIN_REQUEST_DATA::EXTRA_CRC,
35913 TIMESYNC_DATA::ID => TIMESYNC_DATA::EXTRA_CRC,
35914 TIME_ESTIMATE_TO_TARGET_DATA::ID => TIME_ESTIMATE_TO_TARGET_DATA::EXTRA_CRC,
35915 TRAJECTORY_REPRESENTATION_BEZIER_DATA::ID => {
35916 TRAJECTORY_REPRESENTATION_BEZIER_DATA::EXTRA_CRC
35917 }
35918 TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA::ID => {
35919 TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA::EXTRA_CRC
35920 }
35921 TUNNEL_DATA::ID => TUNNEL_DATA::EXTRA_CRC,
35922 UAVCAN_NODE_INFO_DATA::ID => UAVCAN_NODE_INFO_DATA::EXTRA_CRC,
35923 UAVCAN_NODE_STATUS_DATA::ID => UAVCAN_NODE_STATUS_DATA::EXTRA_CRC,
35924 UTM_GLOBAL_POSITION_DATA::ID => UTM_GLOBAL_POSITION_DATA::EXTRA_CRC,
35925 V2_EXTENSION_DATA::ID => V2_EXTENSION_DATA::EXTRA_CRC,
35926 VFR_HUD_DATA::ID => VFR_HUD_DATA::EXTRA_CRC,
35927 VIBRATION_DATA::ID => VIBRATION_DATA::EXTRA_CRC,
35928 VICON_POSITION_ESTIMATE_DATA::ID => VICON_POSITION_ESTIMATE_DATA::EXTRA_CRC,
35929 VIDEO_STREAM_INFORMATION_DATA::ID => VIDEO_STREAM_INFORMATION_DATA::EXTRA_CRC,
35930 VIDEO_STREAM_STATUS_DATA::ID => VIDEO_STREAM_STATUS_DATA::EXTRA_CRC,
35931 VISION_POSITION_ESTIMATE_DATA::ID => VISION_POSITION_ESTIMATE_DATA::EXTRA_CRC,
35932 VISION_SPEED_ESTIMATE_DATA::ID => VISION_SPEED_ESTIMATE_DATA::EXTRA_CRC,
35933 WHEEL_DISTANCE_DATA::ID => WHEEL_DISTANCE_DATA::EXTRA_CRC,
35934 WIFI_CONFIG_AP_DATA::ID => WIFI_CONFIG_AP_DATA::EXTRA_CRC,
35935 WINCH_STATUS_DATA::ID => WINCH_STATUS_DATA::EXTRA_CRC,
35936 WIND_COV_DATA::ID => WIND_COV_DATA::EXTRA_CRC,
35937 _ => 0,
35938 }
35939 }
35940 fn target_system_id(&self) -> Option<u8> {
35941 match self {
35942 Self::AUTOPILOT_STATE_FOR_GIMBAL_DEVICE(inner) => Some(inner.target_system),
35943 Self::CANFD_FRAME(inner) => Some(inner.target_system),
35944 Self::CAN_FILTER_MODIFY(inner) => Some(inner.target_system),
35945 Self::CAN_FRAME(inner) => Some(inner.target_system),
35946 Self::CHANGE_OPERATOR_CONTROL(inner) => Some(inner.target_system),
35947 Self::COMMAND_ACK(inner) => Some(inner.target_system),
35948 Self::COMMAND_CANCEL(inner) => Some(inner.target_system),
35949 Self::COMMAND_INT(inner) => Some(inner.target_system),
35950 Self::COMMAND_LONG(inner) => Some(inner.target_system),
35951 Self::FILE_TRANSFER_PROTOCOL(inner) => Some(inner.target_system),
35952 Self::GIMBAL_DEVICE_ATTITUDE_STATUS(inner) => Some(inner.target_system),
35953 Self::GIMBAL_DEVICE_SET_ATTITUDE(inner) => Some(inner.target_system),
35954 Self::GIMBAL_MANAGER_SET_ATTITUDE(inner) => Some(inner.target_system),
35955 Self::GIMBAL_MANAGER_SET_MANUAL_CONTROL(inner) => Some(inner.target_system),
35956 Self::GIMBAL_MANAGER_SET_PITCHYAW(inner) => Some(inner.target_system),
35957 Self::GPS_INJECT_DATA(inner) => Some(inner.target_system),
35958 Self::LOGGING_ACK(inner) => Some(inner.target_system),
35959 Self::LOGGING_DATA(inner) => Some(inner.target_system),
35960 Self::LOGGING_DATA_ACKED(inner) => Some(inner.target_system),
35961 Self::LOG_ERASE(inner) => Some(inner.target_system),
35962 Self::LOG_REQUEST_DATA(inner) => Some(inner.target_system),
35963 Self::LOG_REQUEST_END(inner) => Some(inner.target_system),
35964 Self::LOG_REQUEST_LIST(inner) => Some(inner.target_system),
35965 Self::MISSION_ACK(inner) => Some(inner.target_system),
35966 Self::MISSION_CLEAR_ALL(inner) => Some(inner.target_system),
35967 Self::MISSION_COUNT(inner) => Some(inner.target_system),
35968 Self::MISSION_ITEM(inner) => Some(inner.target_system),
35969 Self::MISSION_ITEM_INT(inner) => Some(inner.target_system),
35970 Self::MISSION_REQUEST(inner) => Some(inner.target_system),
35971 Self::MISSION_REQUEST_INT(inner) => Some(inner.target_system),
35972 Self::MISSION_REQUEST_LIST(inner) => Some(inner.target_system),
35973 Self::MISSION_REQUEST_PARTIAL_LIST(inner) => Some(inner.target_system),
35974 Self::MISSION_SET_CURRENT(inner) => Some(inner.target_system),
35975 Self::MISSION_WRITE_PARTIAL_LIST(inner) => Some(inner.target_system),
35976 Self::OPEN_DRONE_ID_AUTHENTICATION(inner) => Some(inner.target_system),
35977 Self::OPEN_DRONE_ID_BASIC_ID(inner) => Some(inner.target_system),
35978 Self::OPEN_DRONE_ID_LOCATION(inner) => Some(inner.target_system),
35979 Self::OPEN_DRONE_ID_MESSAGE_PACK(inner) => Some(inner.target_system),
35980 Self::OPEN_DRONE_ID_OPERATOR_ID(inner) => Some(inner.target_system),
35981 Self::OPEN_DRONE_ID_SELF_ID(inner) => Some(inner.target_system),
35982 Self::OPEN_DRONE_ID_SYSTEM(inner) => Some(inner.target_system),
35983 Self::OPEN_DRONE_ID_SYSTEM_UPDATE(inner) => Some(inner.target_system),
35984 Self::PARAM_EXT_REQUEST_LIST(inner) => Some(inner.target_system),
35985 Self::PARAM_EXT_REQUEST_READ(inner) => Some(inner.target_system),
35986 Self::PARAM_EXT_SET(inner) => Some(inner.target_system),
35987 Self::PARAM_MAP_RC(inner) => Some(inner.target_system),
35988 Self::PARAM_REQUEST_LIST(inner) => Some(inner.target_system),
35989 Self::PARAM_REQUEST_READ(inner) => Some(inner.target_system),
35990 Self::PARAM_SET(inner) => Some(inner.target_system),
35991 Self::PING(inner) => Some(inner.target_system),
35992 Self::PLAY_TUNE(inner) => Some(inner.target_system),
35993 Self::PLAY_TUNE_V2(inner) => Some(inner.target_system),
35994 Self::RC_CHANNELS_OVERRIDE(inner) => Some(inner.target_system),
35995 Self::REQUEST_DATA_STREAM(inner) => Some(inner.target_system),
35996 Self::REQUEST_EVENT(inner) => Some(inner.target_system),
35997 Self::RESPONSE_EVENT_ERROR(inner) => Some(inner.target_system),
35998 Self::SAFETY_SET_ALLOWED_AREA(inner) => Some(inner.target_system),
35999 Self::SERIAL_CONTROL(inner) => Some(inner.target_system),
36000 Self::SETUP_SIGNING(inner) => Some(inner.target_system),
36001 Self::SET_ACTUATOR_CONTROL_TARGET(inner) => Some(inner.target_system),
36002 Self::SET_ATTITUDE_TARGET(inner) => Some(inner.target_system),
36003 Self::SET_GPS_GLOBAL_ORIGIN(inner) => Some(inner.target_system),
36004 Self::SET_HOME_POSITION(inner) => Some(inner.target_system),
36005 Self::SET_MODE(inner) => Some(inner.target_system),
36006 Self::SET_POSITION_TARGET_GLOBAL_INT(inner) => Some(inner.target_system),
36007 Self::SET_POSITION_TARGET_LOCAL_NED(inner) => Some(inner.target_system),
36008 Self::SUPPORTED_TUNES(inner) => Some(inner.target_system),
36009 Self::TIMESYNC(inner) => Some(inner.target_system),
36010 Self::TUNNEL(inner) => Some(inner.target_system),
36011 Self::V2_EXTENSION(inner) => Some(inner.target_system),
36012 _ => None,
36013 }
36014 }
36015 fn target_component_id(&self) -> Option<u8> {
36016 match self {
36017 Self::AUTOPILOT_STATE_FOR_GIMBAL_DEVICE(inner) => Some(inner.target_component),
36018 Self::CANFD_FRAME(inner) => Some(inner.target_component),
36019 Self::CAN_FILTER_MODIFY(inner) => Some(inner.target_component),
36020 Self::CAN_FRAME(inner) => Some(inner.target_component),
36021 Self::COMMAND_ACK(inner) => Some(inner.target_component),
36022 Self::COMMAND_CANCEL(inner) => Some(inner.target_component),
36023 Self::COMMAND_INT(inner) => Some(inner.target_component),
36024 Self::COMMAND_LONG(inner) => Some(inner.target_component),
36025 Self::FILE_TRANSFER_PROTOCOL(inner) => Some(inner.target_component),
36026 Self::GIMBAL_DEVICE_ATTITUDE_STATUS(inner) => Some(inner.target_component),
36027 Self::GIMBAL_DEVICE_SET_ATTITUDE(inner) => Some(inner.target_component),
36028 Self::GIMBAL_MANAGER_SET_ATTITUDE(inner) => Some(inner.target_component),
36029 Self::GIMBAL_MANAGER_SET_MANUAL_CONTROL(inner) => Some(inner.target_component),
36030 Self::GIMBAL_MANAGER_SET_PITCHYAW(inner) => Some(inner.target_component),
36031 Self::GPS_INJECT_DATA(inner) => Some(inner.target_component),
36032 Self::LOGGING_ACK(inner) => Some(inner.target_component),
36033 Self::LOGGING_DATA(inner) => Some(inner.target_component),
36034 Self::LOGGING_DATA_ACKED(inner) => Some(inner.target_component),
36035 Self::LOG_ERASE(inner) => Some(inner.target_component),
36036 Self::LOG_REQUEST_DATA(inner) => Some(inner.target_component),
36037 Self::LOG_REQUEST_END(inner) => Some(inner.target_component),
36038 Self::LOG_REQUEST_LIST(inner) => Some(inner.target_component),
36039 Self::MISSION_ACK(inner) => Some(inner.target_component),
36040 Self::MISSION_CLEAR_ALL(inner) => Some(inner.target_component),
36041 Self::MISSION_COUNT(inner) => Some(inner.target_component),
36042 Self::MISSION_ITEM(inner) => Some(inner.target_component),
36043 Self::MISSION_ITEM_INT(inner) => Some(inner.target_component),
36044 Self::MISSION_REQUEST(inner) => Some(inner.target_component),
36045 Self::MISSION_REQUEST_INT(inner) => Some(inner.target_component),
36046 Self::MISSION_REQUEST_LIST(inner) => Some(inner.target_component),
36047 Self::MISSION_REQUEST_PARTIAL_LIST(inner) => Some(inner.target_component),
36048 Self::MISSION_SET_CURRENT(inner) => Some(inner.target_component),
36049 Self::MISSION_WRITE_PARTIAL_LIST(inner) => Some(inner.target_component),
36050 Self::OPEN_DRONE_ID_AUTHENTICATION(inner) => Some(inner.target_component),
36051 Self::OPEN_DRONE_ID_BASIC_ID(inner) => Some(inner.target_component),
36052 Self::OPEN_DRONE_ID_LOCATION(inner) => Some(inner.target_component),
36053 Self::OPEN_DRONE_ID_MESSAGE_PACK(inner) => Some(inner.target_component),
36054 Self::OPEN_DRONE_ID_OPERATOR_ID(inner) => Some(inner.target_component),
36055 Self::OPEN_DRONE_ID_SELF_ID(inner) => Some(inner.target_component),
36056 Self::OPEN_DRONE_ID_SYSTEM(inner) => Some(inner.target_component),
36057 Self::OPEN_DRONE_ID_SYSTEM_UPDATE(inner) => Some(inner.target_component),
36058 Self::PARAM_EXT_REQUEST_LIST(inner) => Some(inner.target_component),
36059 Self::PARAM_EXT_REQUEST_READ(inner) => Some(inner.target_component),
36060 Self::PARAM_EXT_SET(inner) => Some(inner.target_component),
36061 Self::PARAM_MAP_RC(inner) => Some(inner.target_component),
36062 Self::PARAM_REQUEST_LIST(inner) => Some(inner.target_component),
36063 Self::PARAM_REQUEST_READ(inner) => Some(inner.target_component),
36064 Self::PARAM_SET(inner) => Some(inner.target_component),
36065 Self::PING(inner) => Some(inner.target_component),
36066 Self::PLAY_TUNE(inner) => Some(inner.target_component),
36067 Self::PLAY_TUNE_V2(inner) => Some(inner.target_component),
36068 Self::RC_CHANNELS_OVERRIDE(inner) => Some(inner.target_component),
36069 Self::REQUEST_DATA_STREAM(inner) => Some(inner.target_component),
36070 Self::REQUEST_EVENT(inner) => Some(inner.target_component),
36071 Self::RESPONSE_EVENT_ERROR(inner) => Some(inner.target_component),
36072 Self::SAFETY_SET_ALLOWED_AREA(inner) => Some(inner.target_component),
36073 Self::SERIAL_CONTROL(inner) => Some(inner.target_component),
36074 Self::SETUP_SIGNING(inner) => Some(inner.target_component),
36075 Self::SET_ACTUATOR_CONTROL_TARGET(inner) => Some(inner.target_component),
36076 Self::SET_ATTITUDE_TARGET(inner) => Some(inner.target_component),
36077 Self::SET_POSITION_TARGET_GLOBAL_INT(inner) => Some(inner.target_component),
36078 Self::SET_POSITION_TARGET_LOCAL_NED(inner) => Some(inner.target_component),
36079 Self::SUPPORTED_TUNES(inner) => Some(inner.target_component),
36080 Self::TIMESYNC(inner) => Some(inner.target_component),
36081 Self::TUNNEL(inner) => Some(inner.target_component),
36082 Self::V2_EXTENSION(inner) => Some(inner.target_component),
36083 _ => None,
36084 }
36085 }
36086}